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

t0berius's avatar

helper to generate URL to "main url) with ID

How can I use the helper url() function to set an ID onto the "main" url of the application? I tried:

{!! url('', ['id' => Auth::user()->id]) !!}
{!! url('/', ['id' => Auth::user()->id]) !!}

Both doesn't work the way I need it to work, I get:

http://domain.com/13

I would need to get something like this:

http://domain.com/?id=13
0 likes
1 reply
richard's avatar

Do this

{!! url('/?id=' . Auth::user()->id ) !!}

Please or to participate in this conversation.