首先我遇到了一个错误
php artisan migrate
作为
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
然后我找到了一个帖子laracasts
来解决这个问题
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
添加后,当我运行时
php artisan optimize
然后我出现如下新错误
Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLength()
请协助摆脱所有这些错误。