I've added
"laravel/socialite": "~2.0"
as a composer dependency, and i've added the service provider in my config/app.php
just like this
'providers' => [
// more providers
'Laravel\Socialite\SocialiteServiceProvider'
]
Then, when i access to any of my application route, i've got this Class 'Laravel\Socialite\SocialiteServiceProvider' not found
exception.
Looking into my vendor/composer/autoload_psr4.php
i see there's not the Socialite mapping - ive ran composer update
and composer dump-autoload
more than once.
What's wrong?
Did you run the composer command before adding the provider to the file? If not, this can sometimes cause issues.
I recommend removing the reference from the config file and the composer.json, then running composer request laravel/socialite 2.0
. Also, just fyi, using the ::class
notation in the providers listing will help if you're using a full IDE like phpstorm, as it will highlight when it can't find the class.
I have removed the reference from the config file and the composer.json, then ran composer require laravel/socialite 2.0
instead of composer request laravel/socialite 2.0.
Then add the following lines to the config file
Laravel\Socialite\SocialiteServiceProvider::class,
and
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With