Skip to content
Advertisement

How to create pagination using Laravel 6?

i am starting to create an ads site, i display 36 products in a blade index with success, my problem is that 36 of the products display, the leftovers do not display, and i don’t know how to display the 2nd page and 3rd and so on depending on the number of pages to display the other products.

AnnoncesController.php

JavaScript

index.blade.php

JavaScript

Advertisement

Answer

You can do like this

JavaScript

If you want custom pagination, save the following as a new blade file and add name to ->links() method as a parameter.

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