argument('filename'); $format = $this->argument('format'); $urls = include Storage::disk('local')->path($filename); foreach ($urls as $url) { $service = new Service($url, $this->output); if ($format == 'video') { $service->downloadVideo('video'); } elseif ($format == 'audio') { $service->downloadAudio('audio'); } $video_model = Video::create( [ 'path' => $service->getFullPath() ] ); $this->info('Download of ' . $service->getTitle() . ' complete!'); } return Command::SUCCESS; } }