title: Laravel using paginate with only selected columns?
body: <p>I know how to use paginate in laravel ,
  but now I want use paginate()
  with selected columns only .
  this is my pagination code:</p>
  
  <pre><code>$data['users']=DB::table('users')-&gt;paginate(2);
  </code></pre>
  
  <p>this the sql statement I'm trying to get with paginate.</p>
  
  <pre><code>select id,name,username,email,groupName,lastSignIn from users;
  </code></pre>
  
  <p>my laravel code for this select statement:</p>
  
  <pre><code>$data['users']=DB::select('select id,name,username,email,groupName,lastSignIn from users;')-&gt;paginate(4);
  </code></pre>
  
  <p>but it's not working with me?</p>