title: Laravel pagination relationship
body: <p>I asked to create a page that displays a list of all the categories and the last 3 products for each category.</p>
  <p>There is a relationship between the category and the products.</p>
  <p>I am trying to generate a route that will return a Json response.</p>
  <p>Here is my code:</p>
  <pre><code>$category = Category::all()-&gt;load([&quot;products&quot;=&gt;function($res){
              $res-&gt;take(3);
          }]);
          return $category-&gt;paginate(2);
  </code></pre>
  <p>But It returns an error:<code>Collection::paginate does not exist.</code></p>
  <p>What does it mean?</p>
  <p>Thank you</p>