laravel logout redirect

Solutions on MaxInterview for laravel logout redirect by the best coders in the world

showing results for - "laravel logout redirect"
Giada
14 Nov 2018
1This is how I did it. In Auth\LoginController you have:
2
3use AuthenticatesUsers;
4Change it to:
5
6use AuthenticatesUsers {
7    logout as performLogout;
8}
9Then, define a new logout() method in your LoginController:
10
11public function logout(Request $request)
12{
13    $this->performLogout($request);
14    return redirect()->route('your_route');
15}
16Sure, regular logout() method in that trait has only 3 lines (used to log users out of the system) so you can copy them to your method, but you should always follow the DRY principle (don't repeat yourself) and re-use as much code as you can.