title: Laravel get related models of related models
body: <p>I have a RepairRequest model, which is associated with a Vehicle.</p>
  
  <pre><code>class RepairRequest extends \Eloquent {
      public function vehicle() {
          return $this-&gt;belongsTo('Vehicle');
      }
  }
  
  
  class Vehicle extends \Eloquent {
      public function requests() {
          return $this-&gt;hasMany('RepairRequest');
      }
  }
  </code></pre>
  
  <p>I would like to get all RepairRequests for the vehicle associated with a given RepairRequest, so I do</p>
  
  <pre><code>return RepairRequests::find($id)-&gt;vehicle-&gt;requests;
  </code></pre>
  
  <p>This works fine.</p>
  
  <p>However, RepairRequests have RepairItems:</p>
  
  <pre><code>// RepairRequest class
  public function repairItems() {
      return $this-&gt;hasMany('RepairItem', 'request_id');
  }
  
  // RepairItem class
  public function request() {
      return $this-&gt;belongsTo('RepairRequest', 'request_id');
  }
  </code></pre>
  
  <p>which I would like to return too, so I do</p>
  
  <pre><code>return RepairRequests::find($id)-&gt;vehicle-&gt;requests-&gt;with('repairItems');
  </code></pre>
  
  <p>but I get the following exception:</p>
  
  <pre><code>Call to undefined method Illuminate\Database\Eloquent\Collection::with()
  </code></pre>
  
  <p>How can I write this so that the returned json includes the RepairItems in the RepairRequest json?</p>