I\'m building a very simple app in Laravel 5.2, but when using AuthController
\'s action to log out, it just simply doesn\'t work. I have a nav bar which checks
In Http->Middleware->Authenticate.php
change login
in else statement to /
return redirect()->guest('/');
and define following route in routes.php
Route::get('/', function () {
return view('login');
});
for logout call following function:
public function getlogout(){
\Auth::logout();
return redirect('/home');
}
Important: redirect to /home
instead of /
that first calls $this->middleware('auth');
and then in middleware redirect to /