link() ->label('Kirim ulang') ->size('sm') ->action(function (): void { try { $this->rateLimit(2); } catch (TooManyRequestsException $exception) { $this->getRateLimitedNotification($exception)?->send(); return; } $this->sendEmailVerificationNotification($this->getVerifiable()); CheerfulNotification::success( CheerfulNotification::getByKey('auth.email_verification.resend_success.title'), CheerfulNotification::getByKey('auth.email_verification.resend_success.body') )->send(); }); } protected function getRateLimitedNotification(TooManyRequestsException $exception): ?Notification { return CheerfulNotification::danger( CheerfulNotification::getByKey('auth.email_verification.rate_limited.title'), CheerfulNotification::getByKey('auth.email_verification.rate_limited.body', ['seconds' => $exception->secondsUntilAvailable]) )->send(); } }