StartGg
5.1.0
composer require socialiteproviders/startgg
请参阅基本安装指南,然后按照下面的提供商特定说明进行操作。
config/services.php
' startgg ' => [
' client_id ' => env ( ' STARTGG_CLIENT_ID ' ),
' client_secret ' => env ( ' STARTGG_CLIENT_SECRET ' ),
' redirect ' => env ( ' STARTGG_REDIRECT_URI ' )
],
在 Laravel 11 中,默认的EventServiceProvider
提供程序已被删除。相反,请在AppServiceProvider
boot
方法中使用Event
外观上的listen
方法添加侦听器。
Event :: listen ( function ( SocialiteProviders Manager SocialiteWasCalled $ event ) {
$ event -> extendSocialite ( ' startgg ' , SocialiteProviders StartGg Provider ::class);
});
将事件添加到app/Providers/EventServiceProvider
中的listen[]
数组中。有关详细说明,请参阅基本安装指南。
protected $ listen = [
SocialiteProviders Manager SocialiteWasCalled ::class => [
// ... other providers
SocialiteProviders StartGg StartGgExtendSocialite ::class. ' @handle ' ,
],
];
您现在应该能够像定期使用 Socialite 一样使用该提供程序(假设您已安装了外观):
return Socialite :: driver ( ' startgg ' )-> redirect ();
id
nickname
name
email
avatar
discriminator
(用户的唯一标识令牌)