option('dry-run'); if ($isDryRun) { $this->warn('DRY RUN — no emails will be dispatched.'); $this->newLine(); } $leads = UserLead::query()->whereNull('email_verified_at')->get(); if ($leads->isEmpty()) { $this->info('No unverified leads found.'); return self::SUCCESS; } $dispatched = 0; $progressBar = $this->output->createProgressBar($leads->count()); $progressBar->start(); foreach ($leads as $lead) { if (! $isDryRun) { $lead->sendEmailVerificationNotification(); } $dispatched++; $progressBar->advance(); } $progressBar->finish(); $this->newLine(2); $this->table( ['Action', 'Count'], [ ['dispatched'.($isDryRun ? ' (dry run)' : ''), $dispatched], ] ); return self::SUCCESS; } }