option('sync'); $missingOnly = (bool) $this->option('missing-only'); $total = $extractor->extract($missingOnly)->count(); $bar = $this->output->createProgressBar($total); $bar->start(); foreach ($extractor->extract($missingOnly) as $row) { $job = new SyncOrderJob((array) $row); $sync ? dispatch_sync($job) : dispatch($job); $bar->advance(); } $bar->finish(); $this->newLine(); $this->info("Dispatched {$total} order(s) for sync."); app(SyncReport::class)->finish($this); return Command::SUCCESS; } }