Laravel 5 Auth logout not working

For anyone that has problems solving it with the accepted solution: I started with Laravel 5.1 and updated to 5.2. The following fix worked for me:

Try changing your 'logout' route to

Route::get('auth/logout', 'Auth\AuthController@logout');

or in AuthController constructor add

public function __construct()
{
    $this->middleware('guest', ['except' => ['logout', 'getLogout']]);
}

Taken from: https://stackoverflow.com/a/34667356/1275778 (also check the other answers there if you're still having problems afterwards)


Try this..

Put In following code "class AuthController extends Controller"

public function getLogout()
    {
        $this->auth->logout();
        Session::flush();
        return redirect('/');
    }

Tags:

Php

Laravel