'/results']); foreach ($items as $item) { print_r($item); } } } /** * Execute the console command. */ public function handle() { $dir = $this->argument('dir'); $files = File::glob($dir . '/*.txt'); $this->question('Which file to import?'); $i = 1; foreach ($files as $file) { $this->comment("[" . $i++ . "]. " . $file); } $num = $this->ask('Enter number:'); $file = $files[$num - 1]; $this->info('Your choice: ' . $file); $files = explode(PHP_EOL, File::get($file)); $this->ImportToDB($dir, $files); } }