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

↘锁芯ラ 提交于 2019-12-10 14:19:30

问题


I am using laravel lumen 5.2.

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

I came across this error when trying to get Laravel to login with Twitter using the Socialite package.

Work already done:

A) In config\app.php 1. Laravel\Socialite\SocialiteServiceProvider::class 2. 'Socialite' => Laravel\Socialite\Facades\Socialite::class

I followed this : http://goodheads.io/2015/08/24/using-twitter-authentication-for-login-in-laravel-5/


回答1:


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.




回答2:


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



回答3:


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



来源:https://stackoverflow.com/questions/35868055/target-laravel-socialite-contracts-factory-is-not-instantiable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!