

In the routes/web.php add the following lines to create login routes. You can also check this guide to Setup Google Developer account. In the Credentials tab, you can create and set credentials. You also need to create app for and get credentials here.įor Google credentials, go to and create project. 'redirect' => env('GOOGLE_REDIRECT_URL'),įor Facebook credentials, go to and create developer account.

'client_secret' => env('GOOGLE_CLIENT_SECRET'),

'client_secret' => env('FACEBOOK_CLIENT_SECRET'), 'client_id' => env('FACEBOOK_CLIENT_ID'), You can put credentials direct here or load from. We will add Google and Facebook credentials here. Add Social account credentials.Īfter that, go to config/services.php file and add credentials for account whichever you want to include. 'Socialite' => Laravel\Socialite\Facades\Socialite::class, Laravel\Socialite\SocialiteServiceProvider::class,Īdd this line in aliases array to setup alias. If you have Laravel 5.4 or lower, open config/app.php file and register Service provider by adding this line in providers array. composer require laravel/socialite Step 2. Open Terminal and run following command from the root of Laravel application.
#Laravel socialite install
Follow these steps to install and configure social login in your Laravel application. In this tutorial we will create Login with Google and Facebook using Laravel Socialite provided by Laravel. You also need to have Composer installed, that make easy to manage packages from Packagist. We assume you have fresh Laravel application and also enabled Login or else you can enable auth by bellow command. Currently Socialite provides login with Google, Facebook, Twitter, LinkedIn, Github, Gitlab and BitBucket. In addition to default authentication, Laravel also provides login with social accounts using Laravel Socialite. Laravel also provides built-in support for user login and register. Laravel provides many features which makes it popular framework. Laravel is currently most popular web application framework written in PHP.
