Social Authentication with Socialite ― Laravel
Laravel’s Socialite package makes it simple to authenticate your users to Facebook, Twitter, Google, LinkedIn, GitHub and Bitbucket.
In our case we’re going to login with github account
To get started with Socialite, use Composer to add the package to your project’s dependencies:

Than register the Laravel\Socialite\SocialiteServiceProvider in your config/app.phpconfiguration file, providers section:

Next add the Socialite facade to the aliases array in the same configuration file:
You will also need to add credentials for the OAuth services your application utilizes that should be placed in your config/services.php configuration file, and should use the key github . For example:

Finally you will need two routes: one for redirecting the user to the OAuth provider, and another for receiving the callback from the provider after authentication. We will access Socialite using the Socialite facade:

Once you have a user instance, you can grab a few more details about the user:

