argument('file'); if (!file_exists($filePath)) { $this->error("Le fichier spécifié n'existe pas."); return 1; } $file = fopen($filePath, 'r'); while (($line = fgets($file)) !== false) { $data = explode(':', trim($line)); if (count($data) < 5) { $this->error("Format incorrect dans le fichier."); continue; } [$username, $password, $email, $emailPassword, $token] = $data; Account::create([ 'name' => $username, 'password' => $password, 'rambler_email' => $email, 'rambler_password' => $emailPassword, 'auth_token' => $token, ]); $this->info("Utilisateur {$username} importé avec succès."); } fclose($file); $this->info("Importation terminée."); return 0; } }