argument('key'); $job = ImportJob::whereKey($jobKey)->first(); if (is_null($job)) { $this->error('This job does not seem to exist.'); return; } if ($job->status != 'settings_complete') { $this->error('This job is not ready to be imported.'); return; } $this->line('Going to import job with key "' . $job->key . '" of type ' . $job->file_type); $class = config('firefly.import_formats.' . $job->file_type); /** @var ImporterInterface $importer */ $importer = app($class); $importer->setJob($job); // intercept logging by importer. $monolog = Log::getMonolog(); $handler = new CommandHandler($this); $monolog->pushHandler($handler); $importer->start(); $this->line('Something something import: ' . $jobKey); } }