voval921 / socialiteproviders-epicgames
Laravel Socialite 的 Epic Games OAuth2 提供器
1.0.2
2023-01-16 20:00 UTC
Requires
- php: ^5.6 || ^7.0
- ext-json: *
- socialiteproviders/manager: ~3.5
This package is auto-updated.
Last update: 2024-09-17 00:10:25 UTC
README
composer require voval921/socialiteproviders-epicgames
在 config/services.php
中添加配置
'epicgames' => [ 'client_id' => null, 'client_secret' => env('EPICGAMES_CLIENT_SECRET'), 'redirect' => env('EPICGAMES_REDIRECT_URI'), 'allowed_hosts' => [ 'example.com', ] ],
添加提供器事件监听器
配置包的监听器以监听 SocialiteWasCalled
事件。
将事件添加到 app/Providers/EventServiceProvider
中的 listen[]
数组。
protected $listen = [ \SocialiteProviders\Manager\SocialiteWasCalled::class => [ // ... other providers \Voval\Socialite\EpicGames\EpicGamesExtendSocialite::class.'@handle', ], ];
用法
现在您应该能够像通常使用 Socialite 一样使用此提供器(假设您已安装 facade)
return Socialite::driver('epicgames')->redirect();