{"action":"created","issue":{"url":"https://api.github.com/repos/adamwathan/eloquent-oauth-l5/issues/5","labels_url":"https://api.github.com/repos/adamwathan/eloquent-oauth-l5/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/adamwathan/eloquent-oauth-l5/issues/5/comments","events_url":"https://api.github.com/repos/adamwathan/eloquent-oauth-l5/issues/5/events","html_url":"https://github.com/adamwathan/eloquent-oauth-l5/issues/5","id":87802984,"number":5,"title":"OAuth Facade Conflict?","user":{"login":"cillosis","id":1303759,"avatar_url":"https://avatars.githubusercontent.com/u/1303759?v=3","gravatar_id":"","url":"https://api.github.com/users/cillosis","html_url":"https://github.com/cillosis","followers_url":"https://api.github.com/users/cillosis/followers","following_url":"https://api.github.com/users/cillosis/following{/other_user}","gists_url":"https://api.github.com/users/cillosis/gists{/gist_id}","starred_url":"https://api.github.com/users/cillosis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cillosis/subscriptions","organizations_url":"https://api.github.com/users/cillosis/orgs","repos_url":"https://api.github.com/users/cillosis/repos","events_url":"https://api.github.com/users/cillosis/events{/privacy}","received_events_url":"https://api.github.com/users/cillosis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-06-12T17:49:39Z","updated_at":"2015-06-25T18:41:19Z","closed_at":null,"body":"I followed the instructions exactly for installation of this package and used your route based setup from the video for the authorize and login resources, but I consistently get the following error:\r\n\r\n> Call to undefined method OAuth::authorize()\r\n\r\nBeing inside of the **routes.php** file, I am not inside of a namespace, although I also tried `\\OAuth::authorize()` as well. This is the relevant section of my route file:\r\n\r\n    Route::get('google/authorize', function() {\r\n        return OAuth::authorize('google');\r\n    });\r\n    Route::get('google/login', function() {\r\n        return OAuth::login('google', function ($user, $details) {\r\n            dd($details);\r\n        });\r\n    });\r\n\r\nAfter banging my head for a bit, I tried renaming the facade alias in **app.php** to `OAuth2` and changed  my calls to use that instead, *and it worked just fine*.\r\n\r\nI've confirmed that I do not have any other classes in my project or vendor folder with that same name. Doing a global grep of my project shows that the only class with that name is the facade itself (*adamwathan/eloquent-oauth/src/Facades/OAuth.php*), but it is namespaced so shouldn't cause a conflict and I don't have anything else with that name listed in my **app.php** aliases.\r\n\r\nI also just tried upgrading my project to 5.1 since it was just released and have the same issue.\r\n\r\nAnd of course, I have run `composer du` until I am blue in the face just to be sure ;-)\r\n\r\nHave you run into this? If so, do you know what would be causing something like that? I can leave my alias as something else, but it would be nice if I could get it to work as intended."},"comment":{"url":"https://api.github.com/repos/adamwathan/eloquent-oauth-l5/issues/comments/115358651","html_url":"https://github.com/adamwathan/eloquent-oauth-l5/issues/5#issuecomment-115358651","issue_url":"https://api.github.com/repos/adamwathan/eloquent-oauth-l5/issues/5","id":115358651,"user":{"login":"cillosis","id":1303759,"avatar_url":"https://avatars.githubusercontent.com/u/1303759?v=3","gravatar_id":"","url":"https://api.github.com/users/cillosis","html_url":"https://github.com/cillosis","followers_url":"https://api.github.com/users/cillosis/followers","following_url":"https://api.github.com/users/cillosis/following{/other_user}","gists_url":"https://api.github.com/users/cillosis/gists{/gist_id}","starred_url":"https://api.github.com/users/cillosis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cillosis/subscriptions","organizations_url":"https://api.github.com/users/cillosis/orgs","repos_url":"https://api.github.com/users/cillosis/repos","events_url":"https://api.github.com/users/cillosis/events{/privacy}","received_events_url":"https://api.github.com/users/cillosis/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T18:41:19Z","updated_at":"2015-06-25T18:41:19Z","body":"OMG. I think I know why it is doing this. Take a look at this:\r\n\r\nhttp://php.net/manual/en/book.oauth.php\r\n\r\nWhen I tried `dd(get_class_methods('OAuth'))` it came back with a whole list of methods. I googled some of them and came up with that extension. So, it seems the conflict is not necessarily the package, nor an issue with Laravel, it is global.\r\n\r\nFor me, doing this `dd(extension_loaded('OAuth'));` comes back `true`. \r\n\r\nPhew. That took entirely too long to figure out. Might want to either suggest a different name for the facade in the documentation or add a check using `extension_loaded()` to detect if that is loaded and throw an exception."}}