Laravel-Discord Authentication is a project that uses Laravel's built-in authentication system to authenticate users with Discord.
- Go to Discord Developer Portal and create a new application.
Go to OAuth2 and create a new redirect for your application.
It should point to your application's authentication endpoint. (https://domain.com/api/login)
Get the project:
git clone https://github.com/JakyeRU/Laravel-Discord-Authentication.git
cd Laravel-Discord-Authentication
Setup the project; run the following commands within your project:
copy .\.env.example .\.env
Install the required dependencies:
composer install
Generate a new key for your application:
php artisan key:generate
Update .env
with your database credentials before running the migrations.
php artisan migrate
Update .env
with your Discord application details. (DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET DISCORD_REDIRECT_URI)
DISCORD_CLIENT_ID=123456789012345678
DISCORD_CLIENT_SECRET=DPn_n4-3Aol8ZwjDoigrEQN2jtAj4f_
DISCORD_REDIRECT_URI=http://localhost:8000/api/login
Start the server and go to your application.
php artisan serve