Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Discord Laravel Package

socialiteproviders/discord

Discord OAuth2 provider for Laravel Socialite. Adds Discord login to your Laravel app, letting users authenticate via Discord and retrieve their profile, guilds, and connections with minimal setup.

Deep Wiki
Context7

[READ ONLY] Subtree split of the SocialiteProviders/Discord Provider (see SocialiteProviders/Providers)

Frequently asked questions about Discord
How do I install socialiteproviders/discord in a Laravel app?
Install it with Composer using composer require socialiteproviders/discord. Add a discord block with your client ID, secret, and redirect URI to config/services.php, then register the SocialiteProviders listener so the Discord provider is added when Socialite is called. After that you can use Socialite::driver('discord') in your redirect and callback routes.
Which Laravel and Socialite versions does this Discord provider support?
Check the package composer.json for its PHP, illuminate/support, and laravel/socialite constraints before installing. The last subtree release was July 2023, so confirm it resolves cleanly against your current Socialite major version and Laravel 11 or 12. If Composer reports a conflict, the fix is usually to update the SocialiteProviders monorepo package rather than patch this subtree.
How do I configure Discord OAuth credentials in config/services.php?
Add a discord array containing client_id, client_secret, and redirect, reading them from environment variables such as DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET. Create a Discord application in the Discord Developer Portal and add the same callback URL to its OAuth2 redirects. Keep the secret out of source control and cache the config after changes.
What Discord scopes does this package request by default and how do I change them?
The provider ships with default scopes suitable for basic login, usually identify and email, and you can override them with the scopes method or by setting them on the driver. Add guilds or guilds.join only when you actually need guild data or join access, because unnecessary scopes increase consent friction and can break silently when Discord changes scope behavior. Review scopes whenever Discord announces API changes.
Does socialiteproviders/discord work with Laravel 11 and PHP 8.2 or 8.3?
The July 2023 release predates some Laravel 11 adjustments, so verify installation in a throwaway branch before committing. Check the package PHP constraint, Socialite major version, and illuminate/support range with composer why-not if resolution fails. Compatibility fixes are published upstream in the SocialiteProviders monorepo, not in this read-only subtree.
Can I retrieve Discord guilds or connections with this Socialite provider?
The provider returns a normalized Socialite user with fields such as ID, username, avatar, and email, which is what account login needs. Guilds and connections require extra Discord scopes and direct calls to Discord REST endpoints using the access token, so they are outside the core normalized user flow. For bot operations, guild management, or webhooks, use a Discord SDK such as discord-php instead of stretching Socialite.
How do I test Discord login in Laravel without hitting the real Discord API?
Mock the Socialite driver in feature tests so Socialite::driver('discord') returns a fake user with the ID, username, email, and avatar your app expects. Test your callback controller logic against that fake instead of exercising the real OAuth redirect. For any direct Discord HTTP calls, use Laravel HTTP fakes to avoid network access and rate limits.
Is socialiteproviders/discord maintained and safe for production use?
This repository is a read-only subtree split, so stars and activity here are misleading; the canonical source, issues, and releases live in the SocialiteProviders monorepo. Discord's OAuth2 endpoints are stable, so functional decay risk is low, but verify that the current monorepo release installs with your Socialite and PHP versions. Plan a fallback, such as a maintained fork or roughly 100 lines of hand-rolled OAuth2, if the provider becomes unusable.
How do I migrate from a custom Discord OAuth implementation to this provider?
Use a strangler pattern: keep the existing callback route live, add the Socialite-backed redirect and callback under a feature flag, and compare returned Discord IDs and emails for a small cohort before cutting over. Because Socialite normalizes the user into a Laravel Socialite user contract, downstream account-linking code should need little change. Remove the old implementation only after the comparison confirms identical identity mapping.
What are alternatives to socialiteproviders/discord for Discord login in Laravel?
If you already use Laravel Socialite, this provider is the smallest additive option because it plugs into Socialite::driver('discord') and your existing user flow. Alternatives include writing a custom Socialite provider, implementing Discord OAuth2 directly with Laravel's HTTP client in about 100 lines, or using a full Discord SDK when you need bot or guild operations rather than just user login. For non-Laravel services or centralized identity platforms, handle Discord OAuth in that identity layer instead.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings