title: How can i paginate laravel collection?
body: <p>here is how i trying to paginate:</p>
  <pre><code>$posts = Post::all()-&gt;sortByDesc(&quot;created_at&quot;)-&gt;pagination(1);
  </code></pre>
  <p>but i get this error:</p>
  <p>Method Illuminate\Database\Eloquent\Collection::pagination does not exist.</p>