title: Laravel Pagination with a Raw Query
body: <p>I'm using a raw SQL query in Laravel, because it was easier to me at the beginning to make complex queries, so I used them like that.</p>
  
  <p>Now I want to get a list of comments of an user 7, and I would like to paginate the comments, in 5.</p>
  
  <p>That's what I have:</p>
  
  <pre><code>$comments = DB::select( DB::raw("SELECT users.name,  reviews.comment, reviews.comment_score FROM reviews JOIN users WHERE reviews.user_id = :logged_user;")
     ,array('logged_user' =&gt; $user_id,));
  </code></pre>
  
  <p>So this query depends on the user which is consulting the view, receives a variable.</p>
  
  <p>All I see for pagination is with Eloquent queries, and I don't find any clear usage for this.</p>
  
  <p>If I add '->paginate(5)' at the end of the last parenthesis, or later to the variable like $comments->paginate(5);  I get a: </p>
  
  <p>Error: Call to a member function paginate() on array</p>
  
  <p>Some light on this?? </p>
  
  <p>Thanks a lot! =)</p>