redirect to previous page on laravel
Ad
I need to redirect to the previous page once an item is edited but it's redirecting to the same page (edit) again.
I've tried with Redirect::back()
and URL:previous()
. This is the flow:
- (init from one of this two pages) show_pageA or show_pageB
- ->(user clicks edit button) [email protected]
- ->(clicks save) [email protected]
- ->(store method ends redirecting back) [email protected]
Instead of being redirected at the steep 4 to [email protected] I'd like to be redirected to 1. No mather if the page was show_pageA or show_pageB (so I can't do any redirect to specific_page). How can I accomplish this task?
Ad
Answer
Ad
That is the same issue as with redirecting user after a Login - a lot of developers want to redirect to the page from where the user came to login page.
So, what you have to do, is to store the page in the session when you open the GET 'edit' URL and then use it to redirect the user.
Ad
source: stackoverflow.com
Related Questions
Ad
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
Ad