title: Laravel hasMany relationship, limit with query
body: <p><strong>Scenario:</strong>
  On a <code>hasMany</code> relationship, using the <code>with</code> function (for eager loading), I want to limit the results from each of the rows within (instead of the total).</p>
  
  <p>I am following this tutorial (as I think it's the only way to achieve what I need from what I've read on SO) - <a href="https://softonsofa.com/tweaking-eloquent-relations-how-to-get-n-related-models-per-parent/" rel="nofollow noreferrer">https://softonsofa.com/tweaking-eloquent-relations-how-to-get-n-related-models-per-parent/</a></p>
  
  <p>I have a <code>Model</code> - Room that <code>hasMany</code> Reviews.</p>
  
  <p><strong>Room Model:</strong></p>
  
  <pre><code>class Room extends Scopes\BaseModel
  
     public function reviews()
      {
          return $this-&gt;hasMany('App\Review');
      }
  
      public function latestReviews()
      {
          return $this-&gt;reviews()-&gt;latest()-&gt;nPerGroup('room_id', 1);
      }
  </code></pre>
  
  <p><strong>Scopes/BaseModel.php:</strong></p>
  
  <p>Direct copy from the website's tutorial, but with the namespace of <code>namespace App\Scopes;</code></p>
  
  <p><strong>Controller using the with function:</strong></p>
  
  <pre><code>class Room extends Scopes\BaseModel
  
  $rooms = Room::where('room_types_id', $specialism_id)
              -&gt;with('latestReviews')
              -&gt;get();
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>RelationNotFoundException in RelationNotFoundException.php line 20:
    Call to undefined relationship [latestReviews] on model [App\Room].</p>
  </blockquote>