Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.3 Pagination Total number of pages

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?

like image 668
Fominykh Maxim Avatar asked Jan 04 '17 19:01

Fominykh Maxim


1 Answers

Use $results->lastPage() paginator method.

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

like image 55
Alexey Mezenin Avatar answered Nov 10 '22 02:11

Alexey Mezenin