@csuarez You're getting that error because you applied the guest middleware on it. If someone is logged in, they are not a guest. Therefore, they will never reach that function since the middleware prevents them from triggering it.
Sep 7, 2015
6
Level 4
User unable to logout in L5.1.12
Hi Guys, For some reason Laravel refuses to logout. When I print out my route:list, everything looks fine:
GET|HEAD | auth/logout | App\Http\Controllers\Auth\AuthController@getLogout | guest
In the AuthenticatesUsers.php file i try to dd..
public function getLogout()
{
dd('In logout');
...
but I get a 302 server error.
Remote Address:127.0.0.1:80
Request URL:http://controlcenter.dev/auth/logout
Request Method:GET
Status Code:302 Found
Does my page ever reach the getLogout method?
This is shocking because this whole time I've been working on bulk file uploads.
Does anyone know where else I can look for the solution?
thanks
Level 41
@csuarez Try this instead:
$this->middleware('guest', ['except' => ['getLogout', 'postAvatar']]);
Please or to participate in this conversation.