Discord OAuth2 Provider for Laravel Socialite
761,886
34
4
Package Data
Maintainer Username: m1guelpf
Maintainer Contact: eklundchristopher@gmail.com (Christopher Eklund)
Package Create Date: 2016-08-04
Package Last Update: 2024-04-01
Home Page: https://socialiteproviders.com/Discord/
Language: PHP
License: MIT
Last Refreshed: 2024-04-17 15:07:24
Package Statistics
Total Downloads: 761,886
Monthly Downloads: 28,679
Daily Downloads: 1,062
Total Stars: 34
Total Watchers: 4
Total Forks: 15
Total Open Issues: 0

Discord

composer require socialiteproviders/discord

Installation & Basic Usage

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

Add configuration to config/services.php.

'discord' => [    
  'client_id' => env('DISCORD_CLIENT_ID'),  
  'client_secret' => env('DISCORD_CLIENT_SECRET'),  
  'redirect' => env('DISCORD_REDIRECT_URI') 
],

Add provider event listener

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

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

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

Usage

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

return Socialite::with('discord')->redirect();

Returned User fields

  • id
  • nickname
  • name
  • email
  • avatar