[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))

What is the cause:

The MySQL UNIQUE KEY key length limit is 1000 bytes and the system is trying to generate a larger key.

Correction :

Edit the file “vendor \ laravel \ framework \ src \ Illuminate \ Database \ Schema \ Builder.php”. Find the line below

 public static $defaultStringLength = 255; 

Change it as

 public static $defaultStringLength = 250; 

Remove the tables that were created in the database
– migrations
– users

Run php artisan migrate again .