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

grozavule's avatar

Add parameters to current URL's query string

I have a table used on several pages on my application. I would like users to be able to select a column to sort. Is there a better way to link to the same page with additional query parameters than this?

<a href="{{ url(URL::full() . '&sortBy=YourMama&sort=asc' }}"></a>
0 likes
2 replies
Braunson's avatar
Braunson
Best Answer
Level 18

Try this..

{{ request()->fullUrlWithQuery(['foo' => 'bar']) }} 

Please or to participate in this conversation.