Member-only story
Facebook Authentication using Laravel
Nowadays social media is very popular and most favourite customer experience to use social media as their authentication in many websites. The moment you allow users to login using their social media profile, you can skip the validating process of their email because the social media provider already verified them. Hence, It gives a better user experience as users don’t need to create and remember their login credentials for your website. It also saves your time from building a verification flow.
In this article, we will discuss step by step on how to integrate Facebook Login in Laravel using Laravel Socialite. Laravel Socialite package handles flow for social login without hassle — pretty simple.
Without further ado, let’s get started.
Create Migration File
For fresh Laravel project, if you are not migrating yet, you can edit the users migration file. To integrate social login in the application, we need to add 2 more columns which is social_provider_name
and social_provider_id
to the user migration file.
social_provider_name
indicate — the name of the social media
social_provider_id
indicate — the unique id for user social media account