Files
ladill-frontdesk/app/Console/Commands/RenewProSubscriptionsCommand.php
T
isaaccladandCursor 1f6df54d8c
Deploy Ladill Frontdesk / deploy (push) Successful in 58s
Add Frontdesk Pro wallet renewal scheduling.
Monthly auto-renew charges due organizations from the Ladill wallet and downgrades after grace when payment fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 01:07:21 +00:00

23 lines
659 B
PHP

<?php
namespace App\Console\Commands;
use App\Services\Frontdesk\ProRenewalService;
use Illuminate\Console\Command;
class RenewProSubscriptionsCommand extends Command
{
protected $signature = 'frontdesk:pro-renew';
protected $description = 'Charge the Ladill wallet for due Frontdesk Pro subscriptions (and downgrade after the grace window).';
public function handle(ProRenewalService $renewals): int
{
$due = $renewals->dueOrganizations();
$this->info("Renewing {$due->count()} due organization(s).");
$due->each(fn ($organization) => $renewals->renewIfDue($organization));
return self::SUCCESS;
}
}