AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Laravel socialite install11/7/2023 ![]() Enter inside the project: cd laravel-socialite-login-facebook-example. But composer ignores the fail of socialite package, so after composer command completed, they can't find Class 'Laravel\Socialite\SocialiteServiceProvider'. Lets see below example laravel 9 socialite login with google. Run composer command to install a new Laravel application: composer create-project laravel/laravel -prefer-dist laravel-socialite-login-facebook-example. composer tried to download socialite package but failed. If you have any questions feel free to comment on this post. I've checked vender/laravel directory, and socialite wasn't installed. Providers Table), and link each user registered by Laravel Socialite to this table and record the user Provider and other details, and do not forget your own touch. In the end, I hope this article is useful and helpful to you,And remember that this is just a very simple form of the code so that the article is not too long, so try to add what you need (for example You can get the source code for this project from github You can see all user info given by google token by dd the $providerUser in SocialiteController: You may now be wondering how to get access_provider_token, well I'm using a Flutter application created by my friend Fadi Asfour to get this tokens. Now that we've finished the code, let's go to postman and test our routes : This topic will be divided into two sub-sections, as follows. How can Social Login be implemented with Laravel Socialite In this guide, I’ll be using Laravel Socialite to implement social login for Google, Facebook, and GitHub. Only ( 'name', 'email', 'password', 'password_confirmation' ),, 'email' =>, 'password' =>, ]) if ( $validator -> fails ()) return response () -> json ( $validator -> errors (), 400 ) $input = $request -> only ( 'name', 'email', 'password' ) $input = Hash :: make ( $request ) $user = User :: create ( $input ) $data = return response () -> json ( $data, 200 ) } public function login ( Request $request ) Įnter fullscreen mode Exit fullscreen mode Socialite currently supports authentication with Facebook, Twitter, LinkedIn, Google, GitHub, GitLab, and Bitbucket.
0 Comments
Read More
Leave a Reply. |