Laravel 5.7
/
August 23, 2018

5.7 has a new method to customize the number of links on each side of the paginator. Thanks to the new method you no longer need a custom view in some cases. Here’s the API you can use to define the count on each side of the current page:

<?php

User::paginate(10)->linksOnEachSide(5);

Thanks to Michał Putkowski for the contribution, you should check it out to see the implementation. Here’s another visual of what you can expect with this feature, presented by Rachid Laasri:

This new feature will be excellent to cut out the need for a custom template in some cases, but it’s still useful to know how to customize the pagination view.





Source link https://laravel-news.com/laravel-5-7-pagination-link-

LEAVE A REPLY

Please enter your comment!
Please enter your name here