From 11f989d03af290f9ee32bc6e46fad327dd2c1e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Falc=C3=B3n?= Date: Wed, 20 May 2026 11:26:21 +0100 Subject: [PATCH] fix: keep lead invite command aliases (#406) ## Sentry issue - https://whisper-money.sentry.io/issues/PHP-LARAVEL-1H ## Root cause Production invoked old/typoed Artisan command names (`leads:send-invite` / `leads:send-invites`) after the command was named `leads:send-invitations`, causing Symfony CommandNotFoundException before command logic ran. ## Fix - Add compatibility aliases for previous invite command names. - Add regression coverage that both aliases execute successfully. ## Verification - `vendor/bin/pint --dirty --format agent` - `php artisan test --compact tests/Feature/Commands/SendUserLeadInvitationsTest.php` --- app/Console/Commands/SendUserLeadInvitations.php | 5 +++++ tests/Feature/Commands/SendUserLeadInvitationsTest.php | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/app/Console/Commands/SendUserLeadInvitations.php b/app/Console/Commands/SendUserLeadInvitations.php index 8b0d276c..e24fbfcb 100644 --- a/app/Console/Commands/SendUserLeadInvitations.php +++ b/app/Console/Commands/SendUserLeadInvitations.php @@ -22,6 +22,11 @@ class SendUserLeadInvitations extends Command protected $description = 'Send launch invitation emails to the next batch of waitlist leads'; + protected $aliases = [ + 'leads:send-invite', + 'leads:send-invites', + ]; + public function handle(LeadCohortResolver $resolver, LeadPromoCodeAllocator $allocator): int { $limit = (int) $this->option('limit'); diff --git a/tests/Feature/Commands/SendUserLeadInvitationsTest.php b/tests/Feature/Commands/SendUserLeadInvitationsTest.php index ecefea3b..94b4499b 100644 --- a/tests/Feature/Commands/SendUserLeadInvitationsTest.php +++ b/tests/Feature/Commands/SendUserLeadInvitationsTest.php @@ -22,6 +22,15 @@ beforeEach(function (): void { }); }); +it('keeps the previous invite command aliases available', function (string $command): void { + $this->artisan($command, ['--dry-run' => true]) + ->expectsOutput('No pending leads found.') + ->assertSuccessful(); +})->with([ + 'singular alias' => 'leads:send-invite', + 'plural alias' => 'leads:send-invites', +]); + it('sends invitations to the next batch ordered by position', function (): void { UserLead::factory()->count(15)->state(new Sequence( ...array_map(fn (int $i) => ['position' => $i, 'email_verified_at' => now()], range(1, 15)),