Php artisan migrate fails Laravel [duplicate] Php artisan migrate fails Laravel [duplicate] laravel laravel

Php artisan migrate fails Laravel [duplicate]


you have to do is edit your AppServiceProvider.php on App\Providers\AppServiceProvider file and inside the boot method set a default string length:

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

Then drop the database manually then composer dump-autoload and php artisan migrate


Thanks all message

Resolved with next code:

 in config/database.php in mysql section'charset' => 'utf8mb4','collation' => 'utf8mb4_unicode_ci', and replace them with with'charset' => 'utf8','collation' => 'utf8_unicode_ci',


Edit AppServiceProvider.php file, you will find this file in app/Providers/AppServiceProvider.php

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

Then run

composer update

on your terminal. Then try migrating your script, It would solve your problem.