Support the ongoing development of →
posted 8 years ago
Last updated 1 year ago.

You shouldn't be using route parameters like that for pagination. You should be using the query string, which is what it was intended for. And don't say something like "but that's ugly", because that's no reason NOT to use something in the manner in which it was designed to be used.

It sounds like you're rolling your own form of pagination as well. Laravel provides a built-in pagination component which is integrate with the database component and Eloquent. Worth checking out. It will automatically add the page data to the query string when it generates the links for you.



Thanks for the reply.

I did sort out of the routing issue, but I wasn't aware of the pagination component. I'm having a look at it right now.

Some of the information I have to display requires a few database queries, then I have to proceess it through various PHP array functions in order to make it presentable and usable.

If I understand correctly, I can construct the pagination links manually.

Thanks for pointing this out to me.


Sign in to participate in this thread!

Full Stack Europe

Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.