Laravel – 安裝 voyager 遇到 Specified key was too long

使用 Laravel 5.6.33 安裝遇到了

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

那麼只要在 app/Providers/AppServiceProvider.php 添加

use Illuminate\Support\Facades\Schema;
public function boot()
{
    Schema::defaultStringLength(191);
}

就沒問題了!參考網友

發表迴響