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) { $this->info('Starting file: ' . $file); $raw_data = Storage::disk('local')->get($file); $tournament = 'Six Nations ' . explode('-', explode('.txt', $file)[0])[1]; $service = new Service(new SixnationsrugbyAdapter($raw_data, $tournament)); $service->save(); } return Command::SUCCESS; } }