// /app/Providers/AppserviceProvider.php
use IlluminateSupportFacadesSchema;
public function boot()
{
Schema::defaultStringLength(191);
}
# AppServiceProvider.php
use IlluminateSupportFacadesSchema;
public function boot()
{
Schema::defaultStringLength(191);
}
In appProvidersAppServiceProvider.php File
// Add
use IlluminateSupportFacadesSchema;
public function boot() {
// Add In boot function
Schema::defaultStringLength(191);
}
Inside config/database.php, replace this line for mysql
Copy Code
'engine' => null',
with
Copy Code
'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',
Instead of setting a limit on your string lenght.
I had this error and I changed my tables column length smaller for the indexed foreign key columns so I changed it like this:
VARCHAR(1024)
To:
VARCHAR(512)
And run the query again.