It's a bug in an older version of 5.3. Check out this GitHub issue for more info.
Sep 30, 2016
3
Level 6
Laravel 5.3 pagination problem with last page
Currently, I'm working on a Laravel 5.3 project. I'm facing a problem with pagination on the last page. If the last page has more than one item, it will work normally. But if it has only one item, pagination links will disappear.
This is some screenshots:
- The last page has more than 1 item: http://prntscr.com/co5fdf
- The last page has only 1 item (pagination links disappear): http://prntscr.com/co5g43
There's nothing special in my code:
- In controller:
$contacts = Contact::paginate(env('LIMIT'));
- In view:
<div class="pagination pull-right">
{{ $contacts->links() }}
</div>
I haven't found a good way to fix it. Is it a Laravel's bug?
Please or to participate in this conversation.