Problem with Logout in Middleware Guest Laravel 5.3

0

I have the route as follows:

Route::group(['middleware' => 'guest'], function() {

     Route::auth();

});

By clicking on logout, redirect me back to / home (as log in). On the other hand, if the Route :: auth (); I take it out of the middleware, it works perfect and closes session.

It's weird because in the LoginController I have the following:

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

and this would have to go.

    
asked by Juan Pablo B 01.01.2017 в 19:25
source

1 answer

1

The Route::auth(); effectively has to be outside the middleware, since it is responsible for doing all the management of the routes when you start and close session, that middleware will work for the routes you have configured to use guest or not.

    
answered by 03.01.2017 / 16:45
source