![]() 'Socialite' => Laravel\Socialite\Facades\Socialite::class, Laravel\Socialite\SocialiteServiceProvider::class, So, first open your terminal and run bellow command:Īfter install above package we should add providers and aliases in config file, Now open config/app.php file and add service provider and aliase. In first step we will install Socialite Package that provide api to connect with google account. So run bellow command and get clean fresh laravel 6 application.Ĭomposer create-project -prefer-dist laravel/laravel googleLogin In this step, if you haven't laravel 6 application setup then we have to get fresh laravel 6 application. So if you want to also implement login with google gmail account then i will help you step by step instruction. If there login with social than it become awesome. you got more people connect with your website because most of people does not want to fill sign up or sign in form. So if in your application have login with social then it become awesome. every one have social account like gmail, facebook etc. we can easily login using google account in laravel project.Īs we know social media is a become more and more popular in the world. laravel 7/6 socialite provide api to login with gmail account. Before run your project, just clear the cache.Here, i will explain you step by step login with google account in laravel 7/6 using socialite. Set the password null in the database as well inside the database/migrations/users table. After that, use Socialite and SocialProvider Class inside app/Http/Controllers/RegisterController.php file. Add user and provider id into the database/migrations/SocialProvider table file. $ php artisan make:model -m SocialProvider Now, Create a SocialProvider model, so write down the following command. Copy App Secret and Paste into Config/services.php file. ![]() Now, Copy App ID and Paste into Config/services.php file. ![]() Now, Set the path of the Project and Save changes within Settings/Base. After that, Click on Facebook Login -> Settings. Now, Add Product to your App and Click Set Up button of Facebbok Login. Firstly, fill the App Name and Check on who can use your app according to your required. Now, Click the third one option or as your required. Click Login Button and Log in with Facebook. Step 9.So, Go to this URL to generate client_id and client_secret of Facebook. Now, add credentials for the OAuth services in your project config/services.php configuration file. ![]() So, Create the user authentication scaffolding and write down this command: php artisan make:auth Now, Go to config/database.php give the project DB_DATABASE name and DB_USERNAME name. env file to set the project path and give the project DB_DATABASE name and DB_USERNAME name. So, Createa Database for this and Go to XAMPP server->phpMyAdmin->Click New Database-> multilogin. Therefore, write down the following command: $ composer require laravel/socialite Now, install the package of Socialite in git Bash use of composer which provides the interface to OAuth authentication with Google, Facebook, Twitter, and so on. Now, Move to project directory on git Bash, so write down the following command:- $ cd multilogin Write down the following command:- $ composer create-project -prefer-dist laravel/laravel multilogin "5.8.*" Step 1.Firstly, Create a new Project in Laravel, so open git bash. How to Login with Facebook, GOOGLE and twitter in Laravel? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |