How to apply pagination in Lumen?

Volatil3 picture Volatil3 · Aug 15, 2015 · Viewed 10.9k times · Source

How can I make my page paginated so that it shows 10 records/page. I have done this in Laravel but not sure how to do it in Lumen

Answer

Alan Ktquez picture Alan Ktquez · Aug 16, 2015

Paginate is available in Lumen. You will do just the same as in Laravel. Here is the documentation: http://laravel.com/docs/5.1/pagination#basic-usage

I have myself used it in version 5 of Lumen and I can tell you that it works the same.

ex. $users = DB::table('posts')->paginate(10);