Discord OAuth2 Provider for Laravel Socialite
1,012,544
36
4
Package Data
Maintainer Username: m1guelpf
Maintainer Contact: eklundchristopher@gmail.com (Christopher Eklund)
Package Create Date: 2016-08-04
Package Last Update: 2024-11-07
Home Page: https://socialiteproviders.com/Discord/
Language: PHP
License: MIT
Last Refreshed: 2024-11-14 15:06:35
Package Statistics
Total Downloads: 1,012,544
Monthly Downloads: 45,209
Daily Downloads: 2,046
Total Stars: 36
Total Watchers: 4
Total Forks: 14
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