Files
ladill-hosting/app/Console/Commands/RetryPendingHostingFulfillmentCommand.php
T
isaaccladandCursor e251a4cf60
Deploy Ladill Hosting / deploy (push) Failing after 17s
Initial Ladill Hosting app with Gitea deploy pipeline.
Shared web hosting extracted from the platform monolith, with CI deploy
to /var/www/ladill-hosting matching Bird/Domains/Email.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 16:24:20 +00:00

44 lines
1.3 KiB
PHP

<?php
namespace App\Console\Commands;
use App\Models\CustomerHostingOrder;
use App\Jobs\ProvisionHostingOrderJob;
use Illuminate\Console\Command;
class RetryPendingHostingFulfillmentCommand extends Command
{
protected $signature = 'hosting:retry-pending-fulfillment {--limit=50 : Maximum orders to process}';
protected $description = 'Re-queue provisioning for hosting orders held after an upstream failure (e.g. Contabo balance)';
public function handle(): int
{
$limit = max(1, (int) $this->option('limit'));
$orders = CustomerHostingOrder::query()
->where('status', CustomerHostingOrder::STATUS_PENDING_APPROVAL)
->whereNotNull('meta->provisioning_hold')
->with('product')
->latest('id')
->limit($limit)
->get();
$queued = 0;
foreach ($orders as $order) {
$order->update([
'status' => CustomerHostingOrder::STATUS_APPROVED,
'approved_at' => now(),
]);
ProvisionHostingOrderJob::dispatch($order->fresh());
$queued++;
$this->line("Queued provisioning for order #{$order->id} ({$order->domain_name})");
}
$this->info("Queued {$queued} order(s) for reprovisioning.");
return self::SUCCESS;
}
}