Comments (17)
Super bizarre, try dd(OAuth::class)
and see what the underlying class is?
from eloquent-oauth-l5.
Sorry for the delay.
dd(OAuth::class);
Comes back as "OAuth". Although, I tested trying to use that magic constant on arbitrary class names like dd(NonexistantClass::class);
and it comes back as "NonexistantClass" so I am not sure how useful that is.
In your service provider (EloquentOAuthServiceProvider), I tried doing dd($this->app['adamwathan.oauth']);
at the end of the registerOAuthManager()
function and it throws an error about the Reflection class not being able to resolve "hash". It was basically the same issue as this closed ticket: #2
I've spent the last hour and half trying to get to the bottom of it and quite frankly, I have no idea. It might be a symptom of upgrading from 5.0 to 5.1 and the Laravel guide missing something. I've already found a couple weird issues that weren't part of the upgrade docs.
Anyway, great library and if I find something I can do to give back, I will!
from eloquent-oauth-l5.
Hmm weird! Can you by any chance create a minimal Laravel project replicating the issue and throw it up publicly?
from eloquent-oauth-l5.
I created a brand new Laravel 5.1 app and copied over a little bit of my (small) app logic and re-setup this package. Same issue. But, I think I've narrowed something down. When I do this:
Route::get('{provider}/authorize', function($provider) {
return OAuth::authorize($provider);
});
I get:
But, curiously, when I get the service directly, it works fine:
Route::get('{provider}/authorize', function($provider) {
return $this->app['adamwathan.oauth']->authorize($provider);
});
So, for some reason it REALLY does not like the OAuth
name. I've grep'ed my entire project folder including vendors looking for any conflicts and cannot find any. Also, like I said, if I change the facade alias in config/app.php to something like OAuthSomething
it will work fine as well.
I will see about throwing together a fresh dummy install to reproduce the issue.
from eloquent-oauth-l5.
Ok Adam, I created a new project and loaded the package in. I didn't even have to bother with setting up the database or config settings or anything like that because it never gets that far. I only added the service provider and alias to the app.php config. In the routes file, I did this:
Route::get('/', function () {
return OAuth::authorize('facebook');
});
And the result is the error from before:
Call to undefined method OAuth::authorize()
https://github.com/cillosis/eloquent-oauth-l5-issue
from eloquent-oauth-l5.
I just cloned that repo, ran composer install, generated an app key and got this error :(
Are you using Homestead? This was just running it using the built in PHP server under OSX.
from eloquent-oauth-l5.
OMG. I think I know why it is doing this. Take a look at this:
http://php.net/manual/en/book.oauth.php
When 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.
For me, doing this dd(extension_loaded('OAuth'));
comes back true
.
Phew. 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.
from eloquent-oauth-l5.
Ah man that is lame! Ok, I will rename the facade for the next version. It was a shitty name anyways. Thanks for your help!
from eloquent-oauth-l5.
No, not using homestead -- probably should. I'm just running an install on MacOS from http://php-osx.liip.ch.
from eloquent-oauth-l5.
Sure man, no problem. Other than that, its super easy to use. Thanks for making this!
from eloquent-oauth-l5.
A temp fix would be to disable the PHP-Oauth plugin (since its Oauth 1.0 and should be depreciated anyways) of course this does pose a problem for shared hosted sites.
from eloquent-oauth-l5.
@tankerkiller125 Just alias it as something else in your config/app.php
:
'aliases' => [
// ...
'SocialAuth' => 'AdamWathan\EloquentOAuth\Facades\OAuth',
// ...
]
Or don't alias it at all, and instead import the full use AdamWathan\EloquentOAuth\Facades\OAuth
in the classes that need it.
from eloquent-oauth-l5.
SocialAuth looks like a better name than eloquent oauth for this package. Just saying... 👍
from eloquent-oauth-l5.
That is what I ended up using.
from eloquent-oauth-l5.
@skyrpex Agree, maybe will change down the road...
from eloquent-oauth-l5.
I've updated the installation instructions to use SocialAuth
as the facade reference, thankfully doesn't involve changing any code :)
https://github.com/adamwathan/eloquent-oauth-l5/releases/tag/v0.3.1
from eloquent-oauth-l5.
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined method AdamWathan\EloquentOAuth\Facades\OAuth::isDeferred()
from eloquent-oauth-l5.
Related Issues (20)
- Problem with user has same email address on login HOT 1
- Twitter HOT 1
- Add support for Twitter provider HOT 3
- EloquentOAuthServiceProvider not found HOT 4
- cannot get gender from facebook HOT 3
- Exception: Publish package configuration in Laravel 5.2 HOT 1
- API calls from the server require an appsecret_proof HOT 1
- Why are you using another config file? HOT 1
- Nice package but can be framework agnostic. Can you do that please HOT 1
- Support Laravel 5.3 HOT 4
- Installation Problem HOT 1
- Sentinel integration HOT 2
- Error 500 HOT 2
- Tag for Laravel 5.4-support? HOT 3
- Allow more than one scope HOT 12
- Is There a way to auth sending email and password to Facebook or google? HOT 3
- how do i make remember me now?? HOT 2
- login in with a customised guard HOT 1
- already have an account registred with the same email HOT 1
- i got guzzle http exception HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eloquent-oauth-l5.