Laravel: Specified key was too long error

This Error ‘Specified key was too long error’ will come when Laravel migrate artisan will execute because of mysql version.

For fix this, We need to edit AppServiceProvider.php file and change this as given below

use Illuminate\Support\Facades\Schema;

public function boot()
{
    Schema::defaultStringLength(191);
}

Leave a Reply

Your email address will not be published. Required fields are marked *