Waylon  Bruen

Waylon Bruen


How to Create Login with Twitter in Laravel 8 Using Socialite Package

When you want to create the login with Twitter in Laravel 8, you will require the socialite package. This package will allow interacting with the social account login using OAuth. In this entire authorization of Twitter login, the security things are managed by the OAuth system. It makes a secure authentication between the project and the user account. So, it is very much safe for user authorization for your application. The Twitter Login in Laravel 8 will require a developer account. But, if you don’t have then don’t worry. In this post, I will show you the complete steps of creating the functionality of Login with Twitter in the Laravel web project. I have already created the socialite  Facebook Login,  Google Login, and  LinkedIn Login.


  • 1 Prerequisites
  • 2 Create New Project in Laravel 8
  • 3 Create and Configure Database
  • 4 Install UI Auth in Laravel 8 For Login with Twitter
  • 5 Install Laravel Socialite Package
  • 6 Add Provider and Alias for Socialite Package
  • 7 Create and Configure App in Twitter Developer Account
  • 8 Configure Twitter App Credentials in Laravel
  • 9 Add Column in Users Migration Table
  • 10 Add Routes For Login With Twitter
  • 11 Add a Button in Login Page For Twitter Login
  • 12 Twitter Login Result in Laravel 8
  • 13 Conclusion
  • 13.1 Share this:
  • 13.2 Like this:
  • 13.3 Related

** Prerequisites**

I assume you are ready for creating the Laravel 8 project. If not then you will require to have the below configurations.

  • PHP >= 7.3
  • MySQL (version > 5)
  • Apache/Nginx Server
  • VS Code Editor
  • Composer

Create New Project in Laravel 8

Here, I am going to create a new project in Laravel using the composer. So, in the terminal, I have hit the below command.

create new project in laravel
composer create-project --prefer-dist laravel/laravel laravel-socialite

After creating the project, you will require the database configuration for this project.

#laravel 8 #laravel login with twitter #socialite login with twitter

How to Create Login with Twitter in Laravel 8 Using Socialite Package