diff --git a/app/Listeners/SyncUserToResendListener.php b/app/Listeners/SyncUserToResendListener.php index cb0842b9..004746ee 100644 --- a/app/Listeners/SyncUserToResendListener.php +++ b/app/Listeners/SyncUserToResendListener.php @@ -3,7 +3,7 @@ namespace App\Listeners; use App\Services\ResendService; -use Illuminate\Auth\Events\Registered; +use Illuminate\Auth\Events\Verified; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Support\Facades\Log; @@ -11,7 +11,7 @@ class SyncUserToResendListener implements ShouldQueue { public function __construct(public ResendService $resendService) {} - public function handle(Registered $event): void + public function handle(Verified $event): void { if (! config('services.resend.key')) { Log::warning('Resend API key not configured, skipping contact sync'); diff --git a/tests/Feature/Listeners/SyncUserToResendListenerTest.php b/tests/Feature/Listeners/SyncUserToResendListenerTest.php index 26aab6a6..e0d54ede 100644 --- a/tests/Feature/Listeners/SyncUserToResendListenerTest.php +++ b/tests/Feature/Listeners/SyncUserToResendListenerTest.php @@ -3,7 +3,7 @@ use App\Listeners\SyncUserToResendListener; use App\Models\User; use App\Services\ResendService; -use Illuminate\Auth\Events\Registered; +use Illuminate\Auth\Events\Verified; use Illuminate\Support\Facades\Log; use function Pest\Laravel\mock; @@ -21,7 +21,7 @@ test('user is synced to resend contacts', function () { ->once() ->with(Mockery::on(fn ($u) => $u->id === $user->id)); - (new SyncUserToResendListener($resendService))->handle(new Registered($user)); + (new SyncUserToResendListener($resendService))->handle(new Verified($user)); }); test('listener skips sync when api key is not configured', function () { @@ -36,5 +36,5 @@ test('listener skips sync when api key is not configured', function () { $user = User::factory()->create(); - (new SyncUserToResendListener($resendService))->handle(new Registered($user)); + (new SyncUserToResendListener($resendService))->handle(new Verified($user)); });