1071 Specified key was too long; max key length is 767 bytes (Laravel)
This error happen on new applications and using MariaDB or MySQL which lower than v5.7.7 when you try to run php artisan migrate.
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`))
Solution:
Go to your AppServiceProvider.php file, and add this following code in boot function:
use Illuminate\Support\Facades\Schema;
public function boot() {
Schema::defaultStringLength(191);
}