{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/6118","labels_url":"https://api.github.com/repos/laravel/framework/issues/6118/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/6118/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/6118/events","html_url":"https://github.com/laravel/framework/issues/6118","id":45962196,"number":6118,"title":"[5.0] route model binding runing before middleware","user":{"login":"alioygur","id":628322,"avatar_url":"https://avatars.githubusercontent.com/u/628322?v=3","gravatar_id":"","url":"https://api.github.com/users/alioygur","html_url":"https://github.com/alioygur","followers_url":"https://api.github.com/users/alioygur/followers","following_url":"https://api.github.com/users/alioygur/following{/other_user}","gists_url":"https://api.github.com/users/alioygur/gists{/gist_id}","starred_url":"https://api.github.com/users/alioygur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alioygur/subscriptions","organizations_url":"https://api.github.com/users/alioygur/orgs","repos_url":"https://api.github.com/users/alioygur/repos","events_url":"https://api.github.com/users/alioygur/events{/privacy}","received_events_url":"https://api.github.com/users/alioygur/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/laravel/framework/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2014-10-16T08:49:49Z","updated_at":"2015-02-20T00:05:01Z","closed_at":null,"body":"Route model binding runing before middleware, this is bug."},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/75165677","html_url":"https://github.com/laravel/framework/issues/6118#issuecomment-75165677","issue_url":"https://api.github.com/repos/laravel/framework/issues/6118","id":75165677,"user":{"login":"landons","id":562269,"avatar_url":"https://avatars.githubusercontent.com/u/562269?v=3","gravatar_id":"","url":"https://api.github.com/users/landons","html_url":"https://github.com/landons","followers_url":"https://api.github.com/users/landons/followers","following_url":"https://api.github.com/users/landons/following{/other_user}","gists_url":"https://api.github.com/users/landons/gists{/gist_id}","starred_url":"https://api.github.com/users/landons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landons/subscriptions","organizations_url":"https://api.github.com/users/landons/orgs","repos_url":"https://api.github.com/users/landons/repos","events_url":"https://api.github.com/users/landons/events{/privacy}","received_events_url":"https://api.github.com/users/landons/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T00:05:01Z","updated_at":"2015-02-20T00:05:01Z","body":"I just ran into a similar issue, but it was pretty easy to get around with dependency injection:\r\n\r\n    $router->bind('project', function($id)\r\n    {\r\n        App::bind('App\\Contracts\\Project', function() use($id)\r\n        {\r\n            if (($project = Project::findByClient(Auth::user(), $id))) {\r\n                return $project;\r\n            }\r\n\r\n            throw new NotFoundHttpException;\r\n        });\r\n\r\n        return $id;\r\n    });"}}