revolution/socialite-discord
Socialite for Discord
7,937
8
| Install | |
|---|---|
composer require revolution/socialite-discord |
|
| Latest Version: | 1.5.0 |
| PHP: | ^8.0 |
| Laravel: | 6 – 13 |
| License: | MIT |
| Last Updated: | Oct 19, 2026 |
| Links: | GitHub · Packagist |
Maintainer: revolution
Socialite for Discord
https://discordapp.com/developers/docs/topics/oauth2
Overview
This package provides a Discord OAuth2 provider for Laravel Socialite. It allows Laravel applications to authenticate users via their Discord accounts by integrating with Discord's OAuth2 API.
Requirements
- PHP >= 8.0
No version restrictions. It may stop working in future versions.
Installation
composer require revolution/socialite-discord
config/services.php
'discord' => [
'client_id' => env('DISCORD_CLIENT_ID'),
'client_secret' => env('DISCORD_CLIENT_SECRET'),
'redirect' => env('DISCORD_REDIRECT'),
],
.env
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
DISCORD_REDIRECT=
Usage
routes/web.php
Route::get('login', [SocialiteController::class, 'login']);
Route::get('callback', [SocialiteController::class, 'callback']);
SocialiteController
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Laravel\Socialite\Facades\Socialite;
class SocialiteController extends Controller
{
public function login()
{
return Socialite::driver('discord')->redirect();
}
public function callback()
{
$user = Socialite::driver('discord')->user();
dd($user);
}
}
Scopes
https://discordapp.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes
public function login()
{
return Socialite::driver('discord')
->setScopes(['identify', 'email', 'guilds', 'guilds.join'])
->redirect();
}
Demo
https://github.com/invokable/socialite-project
LICENCE
MIT Copyright kawax
Related Packages
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| 1.5.0 | ^8.0 | MIT | |
| 1.4.4 | ^8.0 | MIT | |
| 1.4.3 | ^8.0 | MIT | |
| 1.4.2 | ^8.0 | MIT | |
| 1.4.1 | ^8.0 | MIT | |
| 1.4.0 | ^8.0 | MIT | |
| 1.3.0 | ^7.4|| | MIT | |
| 1.2.2 | ^7.2|| | MIT | |
| 1.2.1 | ^7.2 | MIT | |
| 1.2.0 | ^7.2 | MIT | |
| 1.1.1 | >=7.1.3 | MIT | |
| 1.1.0 | >=7.1.3 | MIT | |
| 1.0.0 | >=7.0.0 | MIT |