title: The "blade" part of getting relationship through other table with Laravel
body: <p>I have 3 tables:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>user</th>
  <th>order</th>
  <th>status</th>
  </tr>
  </thead>
  </table>
  </div>
  <p>I want from a foreach of my users to access the status the they order. So after searching I've find out that :</p>
  <pre><code>'students' =&gt; User::where('name', 'like', '%'.$this-&gt;search.'%')
              -&gt;with('order.status')
              -&gt;paginate(20),
  </code></pre>
  <p>Apparently my relationships are working well for when I 'dd' User I see the Order relationship with the Status relationship.</p>
  <p>But now how do I access the Status table from my <code>@foreach($students as $student)</code> on my <code>.blade.php</code> file?</p>
  <p>I've tryed <code>{{ $student-&gt;orde-&gt;status-&gt;statu }}</code> (statu being the name of the table line I want to access) but Laravel is not happy with this.</p>
  <p>When I do <code>{{ $student-&gt;order }}</code> I get that:</p>
  <pre><code>[
    {
      &quot;id&quot;:1,
      &quot;user_id&quot;:1,
      &quot;statu_id&quot;:1,
      &quot;archive&quot;:0,
      &quot;created_at&quot;:&quot;2021-01-05T11:40:04.000000Z&quot;,
      &quot;updated_at&quot;:&quot;2021-01-05T11:40:04.000000Z&quot;,
      &quot;status&quot;: {
        &quot;id&quot;:1,
        &quot;statu&quot;:&quot;command\u00e9&quot;,
        &quot;created_at&quot;:null,
        &quot;updated_at&quot;:null
      }
    }
  ]
  </code></pre>
  <p>So the thingy I want to access is there. It's just I don't know how to get it.</p>