argument('directory'); if (!Storage::disk('local')->exists($directory)) { $this->error('Could not load file at: ' . Storage::disk('local')->path($directory)); return Command::FAILURE; } $files = Storage::disk('local')->files($directory); foreach ($files as $file) { $tournament = 'Six Nations ' . explode('-', explode('.txt', $file)[0])[1]; $raw_data = Storage::disk('local')->get($file); $service = new Service(new SixnationsrugbyAdapter($raw_data, $tournament)); $service->save(); } return Command::SUCCESS; } }