b4nghh's avatar

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:

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?

0 likes
3 replies
amitbisht511's avatar

I was facing the same problem in laravel 5.3

But after updating problem solved

just run composer update

b4nghh's avatar

@SaeedPrez Thank you very much! @amitbisht511 Because I already published the pagination views so updating Laravel didn't solve the problem.

We need to publish the newer views again.

php artisan vendor:publish --tag=laravel-pagination --force

Please or to participate in this conversation.