Search code examples
phplaravelvoyager

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


I add use Illuminate\Support\Facades\Schema; and schema :: defaultStringLenght (120); in file App/Providers/AppServiceProvider.php and I run cmd php artisan voyager:install --with-dummy to install cms to travel but it me in error.

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()
    {
        //
    }
}

Solution

  • You made spell mistake. It would be defaultStringLength

    Schema::defaultStringLength(120);