Laravel 5.3 Pagination Total number of pages

Fominykh Maxim picture Fominykh Maxim · Jan 4, 2017 · Viewed 22.9k times · Source

I have a Paginator instance $paginator in Laravel App, I want to display 'Last' in pagination, so I need a link to the last page. How to get the last page number in laravel 5.3?

Answer

Alexey Mezenin picture Alexey Mezenin · Jan 4, 2017

Use $results->lastPage() paginator method.

https://laravel.com/docs/5.3/pagination#paginator-instance-methods