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

noreason's avatar

Removing a query parameter from url?

Is there a laravel based way to remove a query string from the url?

I have your typical filtering setup going on and I have no problem building and concatenating multiple queries into my url using route(), but I don't know how to do the opposite...

For instance if I've built up a a url such as http://example.com?color=red&size=large by applying both the color and size filters, my goal would be to generate two links on my view that would remove the specific filter that the user clicks to remove. Example - clicking the [x Red] link would remove the color=red query but leave the size query from the url and clicking [x Large] would remove the size=large query but leave the color query intact.

Any suggestions would be appreciated.

0 likes
0 replies

Please or to participate in this conversation.