get(); if ($sources->isEmpty()) { $this->error('No active sources found. Please add a source first.'); return Command::FAILURE; } $this->info("Found {$sources->count()} active source(s):"); foreach ($sources as $source) { $this->line(" • {$source->name}"); } $sync = $this->option('sync'); if ($sync) { $this->info('Running import synchronously...'); foreach ($sources as $source) { $this->line("Importing from: {$source->name}"); ImportEventsJob::dispatchSync($source); } $this->info('Import completed successfully!'); } else { $this->info('Dispatching import jobs to queue...'); foreach ($sources as $source) { ImportEventsJob::dispatch($source); $this->line("Queued import for: {$source->name}"); } $this->info('All import jobs have been queued!'); } return Command::SUCCESS; } }