Target [Laravel\Socialite\Contracts\Factory] is not instantiable Target [Laravel\Socialite\Contracts\Factory] is not instantiable laravel laravel

Target [Laravel\Socialite\Contracts\Factory] is not instantiable


You would need to add the following in config/app.php

In providers add this

Laravel\Socialite\SocialiteServiceProvider::class

In aliases add this

'Socialite' => Laravel\Socialite\Facades\Socialite::class


What helped me is writing

use Socialite;

in the controller (just the alias, not the full path). And then running

php artisan config:clear

in the terminal.


For me, it was to add $app->register( \Laravel\Socialite\SocialiteServiceProvider::class); to app.php in the bootstrap folder, using Lumen 5.6.