Home » Php » php – Laravel 5.3 Pagination Total number of pages

php – Laravel 5.3 Pagination Total number of pages

Posted by: admin July 12, 2020 Leave a comment

Questions:

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?

How to&Answers:

Use $results->lastPage() paginator method.

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

Answer:

You can using $results->lastPage()

See Document reference

Good luck!