-
-
Save fabinou/5294ae21ac462659eb9e9f7de6b75d91 to your computer and use it in GitHub Desktop.
Ajouter à app/Providers/AppServiceProvider.php : | |
use Illuminate\Support\Facades\Schema; | |
public function boot() | |
{ | |
Schema::defaultStringLength(191); | |
} |
In case it does not suits your needs, let's add 'engine' => 'InnoDB', to config/database.php (mysql array)
it doesn't work for me i mean the Schema::defaultStringLength(191);
It's written : Class "App\Providers\Schema" not found
Does anyone has an answer ?
(i'm french btw)
Aight mb i should've replace the whole file
https://www.developpez.net/forums/d1634622/php/bibliotheques-frameworks/laravel/erreur-migrations-laravel/
after adding this ligne ' Schema::defaultStringLength(191); ' we need to import "Schema"
so w add this 'use Illuminate\Support\Facades\Schema; '
after this ligne ' use Illuminate\Support\ServiceProvider; '
Cette méthode n'a pas marché pour moi, et a même généré une erreur supplémentaire.
J'ai installé la version 10 de Laravel et voici ce qui a marché :
Allez dans le fichier config/database.php
Modifiez :
- 'charset' => 'utf8mb4', en 'charset' => 'utf8',
- 'collation' => 'utf8mb4_unicode_ci', en 'collation' => 'utf8_unicode_ci',
J'espère avoir aidé quelqu'un. 😉
ca marche !