title: Laravel Eloquent: How to select from multiple tables
body: <p>I'm using Laravel and the Eloquent ORM that it provides but I'm struggling to select the data I need.  I have 3 Models</p>
  
  <ul>
  <li>House</li>
  <li>Occupants</li>
  <li>Job</li>
  </ul>
  
  <p>A house can have multiple occupants and I can easily get these using the following.  </p>
  
  <pre><code>$house= House::find($house_id);
  $occupants = $house-&gt;occupants()-&gt;where('active', 1)-&gt;get();
  </code></pre>
  
  <p>This works nicely but I also want to select the job of each occupant.  I've got this as a one to one relationship but the jobs are in a seperate table.  </p>
  
  <p>Is there a way to also <strong>select the related job</strong> for each occupant from the jobs table efficiently?  I'm guessing it would be something like this</p>
  
  <pre><code>$occupants_and_jobs = $house-&gt;occupants()-&gt;where('active', 1)-&gt;job()-&gt;get();
  </code></pre>