If you search, @MichalOravec has that on Github. But I suggest use as is, nothing wrong with ?page=2.
Sep 13, 2023
7
Level 1
Pagination system without URL parameters
Hello,
When using the pagination system that Laravel itself offers, page links look like this:
http://127.0.0.1:8000/blog
http://127.0.0.1:8000/blog?page=2
http://127.0.0.1:8000/blog?page=3
But I wanted a more friendly URL, that is:
http://127.0.0.1:8000/blog
http://127.0.0.1:8000/blog/page/2
http://127.0.0.1:8000/blog/page/3
Is there any way to do this without giving up the pagination features that Laravel already offers?
Level 80
@francuel Laravel chose to use query strings for a reasons. Google also uses query strings in their “best practices”: https://developers.google.com/search/docs/specialty/ecommerce/pagination-and-incremental-page-loading#best-practices-when-implementing-pagination
1 like
Please or to participate in this conversation.