{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/12076","labels_url":"https://api.github.com/repos/laravel/framework/issues/12076/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/12076/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/12076/events","html_url":"https://github.com/laravel/framework/issues/12076","id":129847343,"number":12076,"title":"Laravel 5.2 make:auth middleware does not work","user":{"login":"Cyrille37","id":368965,"avatar_url":"https://avatars.githubusercontent.com/u/368965?v=3","gravatar_id":"","url":"https://api.github.com/users/Cyrille37","html_url":"https://github.com/Cyrille37","followers_url":"https://api.github.com/users/Cyrille37/followers","following_url":"https://api.github.com/users/Cyrille37/following{/other_user}","gists_url":"https://api.github.com/users/Cyrille37/gists{/gist_id}","starred_url":"https://api.github.com/users/Cyrille37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cyrille37/subscriptions","organizations_url":"https://api.github.com/users/Cyrille37/orgs","repos_url":"https://api.github.com/users/Cyrille37/repos","events_url":"https://api.github.com/users/Cyrille37/events{/privacy}","received_events_url":"https://api.github.com/users/Cyrille37/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-29T18:37:43Z","updated_at":"2016-01-29T20:12:58Z","closed_at":null,"body":"Hi,\r\nI looking at Laravel 5.2 and the easy to use \"make:auth\" and the multi-auth.\r\n\r\nI think there is a bug because in the generated middleware **\"App\\Http\\Middleware\\Authenticate\" at handle() method call the $guard parameter is always null**.\r\nSo Laravel use \"default\"=>\"gard\"=>\"xyz defined in \"auth.php\", not the one defined by the $guard property in App\\Http\\Controllers\\Auth\\AuthController.\r\n\r\nBefore the App\\Http\\Middleware\\Authenticate::handle(...) call, **multi-auth** works because the method Illuminate\\Foundation\\Auth\\AuthenticatesUsers::handleUserWasAuthenticated() is well called with the good $this->getGuard() value.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/176949860","html_url":"https://github.com/laravel/framework/issues/12076#issuecomment-176949860","issue_url":"https://api.github.com/repos/laravel/framework/issues/12076","id":176949860,"user":{"login":"Cyrille37","id":368965,"avatar_url":"https://avatars.githubusercontent.com/u/368965?v=3","gravatar_id":"","url":"https://api.github.com/users/Cyrille37","html_url":"https://github.com/Cyrille37","followers_url":"https://api.github.com/users/Cyrille37/followers","following_url":"https://api.github.com/users/Cyrille37/following{/other_user}","gists_url":"https://api.github.com/users/Cyrille37/gists{/gist_id}","starred_url":"https://api.github.com/users/Cyrille37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cyrille37/subscriptions","organizations_url":"https://api.github.com/users/Cyrille37/orgs","repos_url":"https://api.github.com/users/Cyrille37/repos","events_url":"https://api.github.com/users/Cyrille37/events{/privacy}","received_events_url":"https://api.github.com/users/Cyrille37/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T20:12:58Z","updated_at":"2016-01-29T20:12:58Z","body":"After the well logged redirection the Illuminate\\Auth\\AuthManager is instanciated 2 times and only the default guard \"users\" appears :\r\n\r\n Illuminate\\Auth\\\\**AuthManager::__construct**\r\n Illuminate\\Auth\\AuthManager::guard guards: \r\n Illuminate\\Auth\\AuthManager::resolve name: users\r\n Illuminate\\Auth\\\\**AuthManager::createSessionDriver name: users**\r\n Illuminate\\Foundation\\Auth\\AuthenticatesUsers::getGuard guard: admins\r\n Illuminate\\Auth\\AuthManager::guard guards: users\r\n Illuminate\\Auth\\AuthManager::resolve name: salaries\r\n Illuminate\\Auth\\\\**AuthManager::createSessionDriver name: admins**\r\n Illuminate\\Foundation\\Auth\\AuthenticatesUsers::handleUserWasAuthenticated sucess, redirect to \"/home\"\r\n App\\Http\\Middleware\\Authenticate::handle guard: \r\n Illuminate\\Auth\\\\**AuthManager::__construct**\r\n Illuminate\\Auth\\AuthManager::guard guards: \r\n Illuminate\\Auth\\AuthManager::resolve name: users\r\n Illuminate\\Auth\\\\**AuthManager::createSessionDriver name: users**\r\n Illuminate\\Auth\\\\**AuthManager::__construct**\r\n Illuminate\\Auth\\AuthManager::guard guards: \r\n Illuminate\\Auth\\AuthManager::resolve name: users\r\n Illuminate\\Auth\\\\**AuthManager::createSessionDriver name: users**\r\n Illuminate\\Auth\\AuthManager::guard guards: user"}}