title: Laravel Pagination
body: <p>How can I create a pagination in laravel?</p>
  
  <p><strong>My Model</strong></p>
  
  <p><strong>Post</strong></p>
  
  <pre><code>function comments() {
  
      return $this-&gt;hasMany('Comment')
                  -&gt;orderBy('created_at', 'desc');
  }
  </code></pre>
  
  <p><strong>Comment</strong></p>
  
  <pre><code>function posts(){
  
      return $this-&gt;belongsTo('Post');
  }
  </code></pre>
  
  <p><strong>User</strong></p>
  
  <pre><code>function posts(){
  
      return $this-&gt;hasMany('Post');
  }
  
  
  function comments(){
  
      return $this-&gt;hasMany('Comment');
  }
  </code></pre>
  
  <p>UserController</p>
  
  <pre><code>$user = User::find(1); //this will give me all the user's post and comment details
  
  //i know I can do  $user = User::paginate(30) to get 30 user per page
  </code></pre>
  
  <p><strong>What I want to Achieve</strong></p>
  
  <p>I want to create a pagination of 10 comment per page.</p>
  
  <p>Thanks for your help in advance.</p>