Custom queries in a laravel paginator

Submitted by Hoosk - 1 year ago

With this trick we add custom queries in the laravel paginator.

 $users = User::orderBy(\Request::get('orderby'), $order)->paginate($limit);
 $users->addQuery('orderby', \Request::get('orderby'));
comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks