title: Laravel Eloquent limit results for relationship
body: <p>I have a simple set-up of Albums and Images, each album has many images. I can get all the data fine but I want to limit the returned number of images to 3. I have tried passing a closure like so:</p>
  
  <pre><code>Album::with(['images' =&gt;  function($query) { $query-&gt;take(3);}])-&gt;get();
  </code></pre>
  
  <p>This does limit the number of images to 3 but it limits the total count of images to 3 but I want to limit each album to 3 images. So the first album will show 3 images as expected but all the other albums have no images.</p>
  
  <p>I have tried adding a new method to my model like so:</p>
  
  <pre><code>public function limitImages()
  {
      return $this-&gt;hasMany('App\Image')-&gt;limit(3);
  }
  </code></pre>
  
  <p>And I call this in my controller: </p>
  
  <pre><code>Album::with('limitImages')-&gt;get();
  </code></pre>
  
  <p>But this doesn't limit the image count returned at all</p>