Skip to content
Advertisement

Custom pagination view in Laravel 5

Laravel 4.2 has the option to specify a custom view in app/config/view.php such as:

JavaScript

This is gone in Laravel 5 at least regarding view.php.

Is there a way to replicate this behavior in Laravel 5?

Advertisement

Answer

Whereas in Laravel 4.2 I would use:

JavaScript

In Laravel 5 you can replicate the above with the following:

JavaScript

Now in the included view, $object will have the pagination methods available, such as currentPage(), lastPage(), perPage(), etc.

You can view all methods available at http://laravel.com/docs/5.0/pagination

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement