Files
nutzwerte_fi4/app/Notifications/ResetPasswordNotification.php
2025-10-16 16:55:54 +02:00

62 lines
1.8 KiB
PHP

<?php
namespace App\Notifications;
use Filament\Facades\Filament;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Facades\Lang;
class ResetPasswordNotification extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct(private readonly string $token) {}
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject(Lang::get('Reset Password Notification'))
->greeting(Lang::get('Hello')." {$notifiable->name},")
->line(Lang::get('You are receiving this email because we received a password reset request for your account.'))
->action(Lang::get('Reset Password'), $this->resetUrl($notifiable))
->line(Lang::get('This password reset link will expire in :count minutes.', ['count' => config('auth.passwords.'.config('auth.defaults.passwords').'.expire')]))
->line(Lang::get('If you did not request a password reset, no further action is required.'));
}
protected function resetUrl(mixed $notifiable): string
{
return Filament::getResetPasswordUrl($this->token, $notifiable);
}
/**
* Get the array representation of the notification.
*
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
//
];
}
}