调用未定义的方法 Illuminate\Database\Schema\MySqlBuilder::defaultStringLenght()

Call to undefined method Illuminate\Database\Schema\MySqlBuilder::defaultStringLenght()

我在文件 App/Providers/AppServiceProvider.php 中添加使用 Illuminate\Support\Facades\Schema;schema :: defaultStringLenght (120); 并且我 运行 cmd php artisan voyager:install --with-dummy 要安装cms去旅行,但我弄错了。

AppServiceProvider.php

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        schema::defaultStringLenght(120);
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}

你拼错了。它将是 defaultStringLength

Schema::defaultStringLength(120);