Getting the full url to session (intended.url)

Hello,

I have a datatable component that makes use of protected $queryString that includes some filters for the datatable.

Within that component I need to set the intended.url to be used by the login process.

Can you please suggest a way to get the current url (including the query string) so I can keep it in session?

Thank you very much,

Generate it at the controller level and pass it in a variable to receive. In my opinion, this is the best practice if it is not static.

if you wan to save current url within the session
with this simple line of code you will save the desire url with querystring in a session variable
session([‘url’=>url()->full()]);

Thank you.

Yes. It is not static so it changes with every filter selected.
will do it the way you suggested.

Thank you,

The url()->full() is not the url of the page in a dynamic component. In subsequent request, the url()->full() is the url of that request and this is not useful for me.