2016-04-16 9 views
0

Ich versuche, Socialite für make "Login with Facebook" verwenden, aber ich bekomme diesen Fehler kontinuierlich BindingResolutionsException Ziel [Laravel \ Socialite \ Contracts \ Factory] ist nicht instanziierbar. Bitte hilf mir.BindingResolutionsException Ziel [Laravel Socialite Contracts Factory] ist nicht instanziierbar

'providers' => [ 

      .... 
      Sun\Flash\FlashServiceProvider::class, 
      Laravel\Socialite\SocialiteServiceProvider::class 
     ], 

'aliases' => [ 
     .... 
     'Flash'  => Sun\Flash\FlashFacade::class, 
     'PmhAuth' => app\Library\Auth\PmhAuth\PmhAuthFacades::class, 
     'Socialite' => Laravel\Socialite\Facades\Socialite::class 
    ], 

hier ist mein Controller

namespace App\Http\Controllers; 

use Illuminate\Http\Request; 

use App\Http\Requests; 
use App\Http\Controllers\Controller; 
use Laravel\Socialite\Facades\Socialite; 
class SocialAuthController extends Controller 
{ 
    public function redirect() 
    { 
     return Socialite::driver('facebook')->redirect(); 
    } 
    public function callback() 
    { 

    } 
} 

Antwort

1

Da Sie Socialite in der Config aliased haben:

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

Versuchen Sie den Import der Alias:

namespace App\Http\Controllers; 

use Illuminate\Http\Request; 

use Socialite; 
use App\Http\Requests; 
use App\Http\Controllers\Controller; 

class SocialAuthController extends Controller 
{ 
    public function redirect() 
    { 
     return Socialite::driver('facebook')->redirect(); 
    } 
    public function callback() 
    { 

    } 
} 
Verwandte Themen