项目作者: SocialiteProviders

项目描述 :
[READ ONLY] Subtree split of the SocialiteProviders/QQ Provider (see SocialiteProviders/Providers)
高级语言: PHP
项目地址: git://github.com/SocialiteProviders/QQ.git
创建时间: 2015-05-27T06:12:22Z
项目社区:https://github.com/SocialiteProviders/QQ

开源协议:

下载


QQ

  1. composer require socialiteproviders/qq

Installation & Basic Usage

Please see the Base Installation Guide, then follow the provider specific instructions below.

Add configuration to config/services.php

  1. 'qq' => [
  2. 'client_id' => env('QQ_CLIENT_ID'),
  3. 'client_secret' => env('QQ_CLIENT_SECRET'),
  4. 'redirect' => env('QQ_REDIRECT_URI')
  5. ],

Add provider event listener

Laravel 11+

In Laravel 11, the default EventServiceProvider provider was removed. Instead, add the listener using the listen method on the Event facade, in your AppServiceProvider boot method.

  • Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.
  1. Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
  2. $event->extendSocialite('qq', \SocialiteProviders\QQ\Provider::class);
  3. });


Laravel 10 or below

Configure the package’s listener to listen for SocialiteWasCalled events.

Add the event to your listen[] array in app/Providers/EventServiceProvider. See the Base Installation Guide for detailed instructions.

php protected $listen = [ \SocialiteProviders\Manager\SocialiteWasCalled::class => [ // ... other providers \SocialiteProviders\QQ\QQExtendSocialite::class.'@handle', ], ];

Usage

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):

  1. return Socialite::driver('qq')->redirect();

Returned User fields

  • id
  • unionid
  • nickname
  • avatar