Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

EmilMoe's avatar
Level 10

Keep existing Query String

Are there any clever ways of preserving query strings when I have a page mixed up with tables (column sort), search and pagination. All 3 different components working together. I would rather keep it as they are not aware of each others query string parameters.

It seems like withQueryString() is only working for pagination, so when i sort by a column the pagination and search etc are gone.

Best suggestion I found is this, but maybe there is a more built in approach in Inertia or Laravel? https://stackoverflow.com/a/74655234

0 likes
1 reply
EmilMoe's avatar
EmilMoe
OP
Best Answer
Level 10

Found the solution within Ziggy

:href="route(route().current(), { ...route().params, sort: column.id, direction: direction })"

Please or to participate in this conversation.