本文整理汇总了PHP中Laravel\Socialite\Facades\Socialite::extend方法的典型用法代码示例。如果您正苦于以下问题:PHP Socialite::extend方法的具体用法?PHP Socialite::extend怎么用?PHP Socialite::extend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Laravel\Socialite\Facades\Socialite
的用法示例。
在下文中一共展示了Socialite::extend方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Socialite::extend('google2', function () {
$config = $this->app['config']['services.google'];
return Socialite::buildProvider(\App\GoogleProvider::class, $config);
});
}
示例2: getMw
function getMw($action = '')
{
Socialite::extend('microweber', function ($app) {
$config = $app['config']['services.microweber'];
return Socialite::buildProvider('Microweber\\Providers\\Socialite\\MicroweberProvider', $config);
});
if ($action == 'callback') {
$user = Socialite::driver('microweber')->user();
$user = UserProvider::findOrCreate($user, 'microweber');
Auth::login($user);
return Redirect::intended('/');
}
return Socialite::driver('microweber')->redirect();
}
示例3: bootOlxDriver
/**
* Boot OlxDriver
*
* @return void
*/
protected function bootOlxDriver()
{
if (class_exists(Socialite::class)) {
Socialite::extend('olx', function ($app) {
$config = $app['config']['services.olx'];
return new OlxProvider($app['request'], $config['client_id'], $config['client_secret'], $config['redirect']);
});
}
}