1#Method 1 with route name
2return redirect()->route('login');
3
4#Method 2 back with input
5return back()->withInput();
6
7#Method 2 using a url
8return redirect('/home/dashboard');
11. The cleanest way seems to be using the url() helper:
2 {{ url()->previous() }}
3
42. URL::previous() works for me in my Laravel 5.1 project. Here is Laravel 5.1
5 doc for previous() method, which is accessible through URL Facade.
6
73. You can still try alternatives, in your views you can do:
8
9 {{ redirect()->getUrlGenerator()->previous() }}
10 OR
11 {{ redirect()->back()->getTargetUrl() }}
1// For a route with the following URI: profile/{id}
2
3return redirect()->route('profile', [$user]);
1// For a route with the following URI: profile/{id}
2
3return redirect()->route('profile', ['id' => 1]);