Luke Jones

intervle - commit dcfd04f

feat: loop through CSV and create event datadcfd04f10946053306a602665a73b04f9e8ee2d8LukeJ<luke.jones.2567@gmail.com>2026-03-09T20:19:06Z
diff --git a/app/Console/Commands/ImportEventData.php b/app/Console/Commands/ImportEventData.php index 9334722..afcf9d8 100644 --- a/app/Console/Commands/ImportEventData.php +++ b/app/Console/Commands/ImportEventData.php @@ -22,6 +22,19 @@ class ImportEventData extends Command return Command::FAILURE; } - dd($handle); + $count = 0; + + while (($row = fgetcsv($handle)) !== false) { + [$date, $description] = $row; + + Event::firstOrCreate([ + 'date' => $date, + 'description' => $description + ]); + + $count++; + } + + fclose($handle); } }