{"action":"created","issue":{"url":"https://api.github.com/repos/kodeine/laravel-acl/issues/46","labels_url":"https://api.github.com/repos/kodeine/laravel-acl/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/kodeine/laravel-acl/issues/46/comments","events_url":"https://api.github.com/repos/kodeine/laravel-acl/issues/46/events","html_url":"https://github.com/kodeine/laravel-acl/issues/46","id":76306045,"number":46,"title":"Error when using as Global Middleware.","user":{"login":"cirdog","id":172924,"avatar_url":"https://avatars.githubusercontent.com/u/172924?v=3","gravatar_id":"","url":"https://api.github.com/users/cirdog","html_url":"https://github.com/cirdog","followers_url":"https://api.github.com/users/cirdog/followers","following_url":"https://api.github.com/users/cirdog/following{/other_user}","gists_url":"https://api.github.com/users/cirdog/gists{/gist_id}","starred_url":"https://api.github.com/users/cirdog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cirdog/subscriptions","organizations_url":"https://api.github.com/users/cirdog/orgs","repos_url":"https://api.github.com/users/cirdog/repos","events_url":"https://api.github.com/users/cirdog/events{/privacy}","received_events_url":"https://api.github.com/users/cirdog/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-14T10:02:04Z","updated_at":"2015-05-20T18:44:27Z","closed_at":null,"body":"Hi Devs,\r\n\r\nThanks for your wonderful contribution.\r\n\r\nI've been using your module smoothly so far, up to when I use it as a \"Global Middleware\", placing it in the Kernel.php's $middleware array.\r\n\r\nThe $this->request->route() returns NULL when HasPermission.php is being called during the pipeline.\r\n\r\nIf this is trivial to fix please kindly help, since it would be very useful to have all routes going through ACL while only exempting a few for public use, especially for some internal system use cases.\r\n\r\nThanks very much.\r\n\r\n-Godric\r\n\r\n```\r\nBadMethodCallException in HasPermission.php line 162: Call to a member function getAction() on a non-object (NULL)\r\n\r\n    in HasPermission.php line 162\r\n    at HasPermission->getAction('is') in HasPermission.php line 45\r\n    at HasPermission->handle(object(Request), object(Pipeline::getInitialSlice;1764878495)) in Pipeline.php line 125\r\n    at {closure}(object(Request)) in VerifyCsrfToken.php line 43\r\n    at VerifyCsrfToken->handle(object(Request), object(Pipeline::getSlice;1764878495)) in VerifyCsrfToken.php line 17\r\n    at VerifyCsrfToken->handle(object(Request), object(Pipeline::getSlice;1764878495)) in Pipeline.php line 125\r\n    at {closure}(object(Request)) in ShareErrorsFromSession.php line 55\r\n    at ShareErrorsFromSession->handle(object(Request), object(Pipeline::getSlice;1764878495)) in Pipeline.php line 125\r\n    at {closure}(object(Request)) in StartSession.php line 61\r\n    at StartSession->handle(object(Request), object(Pipeline::getSlice;1764878495)) in Pipeline.php line 125\r\n    at {closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36\r\n    at AddQueuedCookiesToResponse->handle(object(Request), object(Pipeline::getSlice;1764878495)) in Pipeline.php line 125\r\n    at {closure}(object(Request)) in EncryptCookies.php line 40\r\n    at EncryptCookies->handle(object(Request), object(Pipeline::getSlice;1764878495)) in Pipeline.php line 125\r\n    at {closure}(object(Request)) in CheckForMaintenanceMode.php line 42\r\n    at CheckForMaintenanceMode->handle(object(Request), object(Pipeline::getSlice;1764878495)) in Pipeline.php line 125\r\n    at {closure}(object(Request))\r\n    at call_user_func(object(Pipeline::getSlice;1764878495), object(Request)) in Pipeline.php line 101\r\n    at Pipeline->then(object(Kernel::dispatchToRouter;1047617302)) in Kernel.php line 115\r\n    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84\r\n    at Kernel->handle(object(Request)) in index.php line 53\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kodeine/laravel-acl/issues/comments/103991327","html_url":"https://github.com/kodeine/laravel-acl/issues/46#issuecomment-103991327","issue_url":"https://api.github.com/repos/kodeine/laravel-acl/issues/46","id":103991327,"user":{"login":"kodeine","id":8620059,"avatar_url":"https://avatars.githubusercontent.com/u/8620059?v=3","gravatar_id":"","url":"https://api.github.com/users/kodeine","html_url":"https://github.com/kodeine","followers_url":"https://api.github.com/users/kodeine/followers","following_url":"https://api.github.com/users/kodeine/following{/other_user}","gists_url":"https://api.github.com/users/kodeine/gists{/gist_id}","starred_url":"https://api.github.com/users/kodeine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodeine/subscriptions","organizations_url":"https://api.github.com/users/kodeine/orgs","repos_url":"https://api.github.com/users/kodeine/repos","events_url":"https://api.github.com/users/kodeine/events{/privacy}","received_events_url":"https://api.github.com/users/kodeine/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T18:44:27Z","updated_at":"2015-05-20T18:44:27Z","body":"@cirdog \r\nWere you able to solve this? or should i test at my machine? (sorry for late response)."}}