title: Laravel - how to use paginate with parameters
body: <p>How can I use pagination with vuejs and laravel</p>
  
  <p>I first used this in order to have my posts with users,categories and photo.</p>
  
  <pre><code>public function index()
  {
      //
      $posts = Post::with('user', 'category', 'photo')-&gt;orderBy('id', 'desc')-&gt;get();
      return response()-&gt;json([
          'posts' =&gt; $posts,
      ], 200);
  }
  </code></pre>
  
  <p>All works, but now I want to add pagination and for some reason it does not work. I did like this:</p>
  
  <pre><code>$posts = Post::with('user', 'category', 'photo')-&gt;orderBy('id', 'desc')-&gt;paginate(5)-&gt;get(); 
  </code></pre>
  
  <p>How can I make my pagination work?</p>