Support the ongoing development of Laravel.io →
Requests Input Views
Last updated 2 years 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 2 years 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 2 years ago.
0

Still didn't find solution. Any ideas?

Last updated 2 years ago.
0

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

Hope that helps you. Tommy

Last updated 2 years 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 controller@create 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 controller@index. Then you should store the current url.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.