2017-03-02 69 views
0

,我不能在文件EventServiceProvider同時 使用兩個SocialiteProviders問題使用多種OAuth,我有以下不能在laravel

protected $listen = [ 
    'App\Events\SomeEvent' => [ 
     'App\Listeners\EventListener', 
    ], 
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [ 
     // add your listeners (aka providers) here 
     'SocialiteProviders\VKontakte\[email protected]', 
    ], 
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [ 
     \JhaoDa\SocialiteProviders\Odnoklassniki\OdnoklassnikiExtendSocialite::class 
    ], 
]; 

所以如果Odnoklassniki提供商合作,沒有使用Vkontakte提供商的可能性。它給出以下內容:

Manager.php中的InvalidArgumentException行90: 不支持驅動程序[vkontakte]。

如果我評論Odnoklassniki,銥也不會工作。

如何使它同時工作。

回答

0

當您使用同一個數組的鍵放置另一個項目時,它將覆蓋以前的值。只需將它們添加到一個鍵:

protected $listen = [ 
    'App\Events\SomeEvent' => [ 
     'App\Listeners\EventListener', 
    ], 
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [ 
     // add your listeners (aka providers) here 
     'SocialiteProviders\VKontakte\[email protected]', 
     \JhaoDa\SocialiteProviders\Odnoklassniki\OdnoklassnikiExtendSocialite::class 
    ], 
];