whereNotNull('stripe_price_sync') ->whereNotNull('stripe_subscription_id') ->where('status', 'active') ->orderBy('id') ->limit((int) $this->option('limit')) ->get(); $moved = 0; foreach ($parked as $subscription) { if ($move->retry($subscription)) { $moved++; continue; } // The action has already logged why and counted the attempt. Said // again here because somebody is watching this command's output // and not the log. $this->warn(sprintf( 'Contract %s: still billed at the old price — %s', $subscription->uuid, (string) ($subscription->fresh()?->stripe_price_sync['error'] ?? 'unknown'), )); } $this->info("{$parked->count()} contract(s) out of step with Stripe, {$moved} moved."); return self::SUCCESS; } }