use Laravel\Socialite\Facades\Socialite;
public function redirectToDiscord()
{
return Socialite::driver('discord')->redirect();
}
use Laravel\Socialite\Facades\Socialite;
public function handleDiscordCallback()
{
$user = Socialite::driver('discord')->user();
// Access user details
$id = $user->getId();
$name = $user->getName();
$nickname = $user->getNickname();
$email = $user->getEmail();
$avatar = $user->getAvatar();
// Handle the user data
}