在试图执行migrate迁移时发生如下错误:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQ
L: alter table `users` add unique `users_name_unique`(`name`))
其解决方式如下:
在
app\Providers\AppServiceProvider.php
文件的boot方法中加入
\Schema::defaultStringLength(191);
即可解决。