vrkansagara
1 month ago
1147
1
Requests

How to get Socialite Dynamic driver name ?

Posted 1 month ago by vrkansagara

I want driver name from request payload. like github, twitter or facebook, etc. The current problem is that I have to explicitly provide a driver name.

public function handleProviderCallback(Request $request)
{
    try {
        $user = Socialite::driver('github')->user();
        return redirect()->route('dashboard');
    } catch (\Exception $exception) {
        return $exception;
    }
}

Please sign in or create an account to participate in this conversation.