Fix wizard : config:clear avant migrations pour éviter conflit pgsql/mysql

Sans ce clear, un bootstrap/cache/config.php résiduel (produit par
php artisan optimize en dev) est lu en priorité sur le .env réécrit
par writeEnv(), forçant une connexion pgsql même quand mysql est choisi.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 22:02:45 +02:00
parent c3e1d4378c
commit 715aad58e1
+6
View File
@@ -145,6 +145,12 @@ class SetupController extends Controller
if (! $ok) $success = false; if (! $ok) $success = false;
} }
// 2b. Purge du cache de config pour forcer la lecture du nouveau .env
// (un bootstrap/cache/config.php résiduel sinon l'emporte sur le .env réécrit)
if ($success) {
$this->artisanRun($artisan, 'config:clear');
}
// 3. Migrations // 3. Migrations
if ($success) { if ($success) {
[$ok, $out] = $this->artisanRun($artisan, 'migrate --force'); [$ok, $out] = $this->artisanRun($artisan, 'migrate --force');