mardi 5 juin 2018

Laravel store GET parameters to redirect back

In my application I currently have a dashboard, this dashboard accepts a list of GET parameters to do things like filter, and for pagination.

An example of my url is this

http://mysite.local/dashboard?filters=true&search=&optIn=on&dateFrom=&dateTo=&submit=Search&page=3

On my dashboard I can then a link which will take me to a users information, so I can edit it. Inside my users page I can have a button that just has inside it, to go back to my dashboard and keep all of my GET parameters.

The issue is the users page has the ability to update, which sends a request to a POST controller, then returns back to the users page with a success or error message, and this can be done and updated as many times as possible, so once this is done the url()->previous is now the users page, and i lose the dashboard url with all of my parameters.

I need to be able to keep the dashboard url with all of the GET parameters so that once the user is done on the users page, they can always get back to the dashboard with their filters and page.

Whats the best way to achieve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire