comment(Inspiring::quote()); })->purpose('Display an inspiring quote'); // Import cards from CSV via CLI without a custom Console Kernel (Laravel 12 console routes) Artisan::command('cards:import {file : Absolute path to the CSV file} {--delimiter=, : CSV delimiter} {--dry-run : Parse without writing}', function (string $file) { $delimiter = (string) $this->option('delimiter'); $dryRun = (bool) $this->option('dry-run'); $importer = new CardCsvImporter(); try { [$inserted, $updated, $skipped] = $importer->import($file, $delimiter, $dryRun); if ($dryRun) { $this->info("Dry run complete."); } $this->info("Import finished. Inserted: {$inserted}, Updated: {$updated}, Skipped: {$skipped}"); } catch (\Throwable $e) { $this->error($e->getMessage()); } })->purpose('Import cards from a CSV file (upsert by name).');