Support the ongoing development of Laravel.io →
Requests Input Views
Last updated 3 months ago.
0

Change URL::previous() to the actual route URL::route('index') or something, otherwise previous points to the previous page, and after submitting previous is '/page/create'

The validator can redirect using the back() method, Redirect::back()

Last updated 3 months ago.
0

briankip said:

Change URL::previous() to the actual route URL::route('index') or something, otherwise previous points to the previous page, and after submitting previous is '/page/create'

The validator can redirect using the back() method, Redirect::back()

First of all thanks for reply. The point is, that on index i have some kind of filter which is using URL parameters eg:

page/index?name=test&category=0

With "Go back" button on create page, i'm trying to return to index with these parameters, so the filter will be applied (still active).

Last updated 3 months ago.
0

Still didn't find solution. Any ideas?

Last updated 3 months ago.
0

I found the temporary solution is that you write query string into session everytime access to [email protected] by Session::push. Then, you put Session::get where you want to back to the list.

Hope that helps you. Tommy

Last updated 3 months ago.
0

Yes! you can use sessions instead of URL::previous()

//put key into session

Session::put('backUrl', URL::previous());

//get the key from session

Session::get('backUrl');

0

I don't think you should put the previous url in the session. I tried this in [email protected] and it still does the same thing as it did before, since now it's setting the previous url (which is also the create) after the validation. So htdung83 is right and it should be in the [email protected] Then you should store the current url.

0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.