command->info('Désactivation des contraintes de clés étrangères...'); DB::statement('SET FOREIGN_KEY_CHECKS=0;'); foreach ($tables as $tableName) { if (Schema::hasTable($tableName)) { $this->command->info("Tronquage de la table : {$tableName}"); DB::table($tableName)->truncate(); } else { $this->command->warn("La table {$tableName} n'existe pas, elle a été sautée."); } } DB::statement('SET FOREIGN_KEY_CHECKS=1;'); $this->command->info('Réinitialisation terminée avec succès !'); } }