Files
fotospiel-app/app/Notifications/ResetPasswordNotification.php
Codex Agent 54b3fa0d87
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled
Add event-admin password reset flow
2026-01-06 11:02:09 +01:00

35 lines
1.0 KiB
PHP

<?php
namespace App\Notifications;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Notifications\Messages\MailMessage;
class ResetPasswordNotification extends ResetPassword
{
public function toMail($notifiable): MailMessage
{
$resetUrl = $this->resetUrl($notifiable);
$expire = (int) config('auth.passwords.'.config('auth.defaults.passwords').'.expire', 60);
return (new MailMessage)
->subject(__('emails.reset_password.subject'))
->view('emails.reset-password', [
'user' => $notifiable,
'resetUrl' => $resetUrl,
'expiresIn' => $expire,
]);
}
protected function resetUrl($notifiable): string
{
$email = method_exists($notifiable, 'getEmailForPasswordReset')
? $notifiable->getEmailForPasswordReset()
: $notifiable->email;
$query = http_build_query(['email' => $email]);
return url("/event-admin/reset-password/{$this->token}?{$query}");
}
}