title: Laravel Eloquent relationship fetching third table/relation value
body: <p>I have 3 tables in a database</p>
  
  <ol>
  <li>Transaction <code>{'id','bill_id','remark'}</code></li>
  <li>Bills <code>{'id','third_party','amount'}</code></li>
  <li>ThirdParty <code>{'id','company_name',remark}</code></li>
  </ol>
  
  <p>The <strong>'transaction'</strong> table has column <code>bill_id</code> coming from <strong>'Bills'</strong> and Bills table has <code>'third_party'</code> column which connected to ThirdParty table <strong>column -> 'id'</strong></p>
  
  <p>So here I am trying to fetch <code>company_name</code> using laravel eloquent relation</p>
  
  <p>My <strong>Transaction</strong> model:</p>
  
  <pre><code>public function Bills()
  {
      return $this-&gt;hasOne('App\Bills','id','bill_id');
  }
  </code></pre>
  
  <p><strong>Bills:</strong></p>
  
  <pre><code>public function third_party()
  {
      return $this-&gt;belongsTo('App\ThirdParty','third_party','id');
  } 
  </code></pre>
  
  <p>I am getting <strong>null</strong> value for <code>company_name</code></p>
  
  <p><a href="https://i.stack.imgur.com/NSNZT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NSNZT.png" alt="enter image description here"></a></p>
  
  <p>Here is the query i am using </p>
  
  <pre><code>Transaction::with('Bills.third_party')-&gt;get();
  </code></pre>
  
  <p>And i have corrected in question (third_party_name) to company_name column name i wrote here was my old join query name which is visible in screenshot, basically i am trying to fetch company name.</p>