feat(Password process for new admin, cleaning translations)
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m21s

This commit is contained in:
2026-04-01 15:50:21 +02:00
parent 83b7c42fe4
commit 25885e3b70
40 changed files with 1577 additions and 475 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Notifications;
use App\Models\NotificationTemplate;
use Filament\Facades\Filament;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class AdminPasswordResetNotification extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(protected string $token) {}
/**
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
$template = NotificationTemplate::findByIdentifier('admin_password_reset');
$url = Filament::getPanel('admin')->getResetPasswordUrl($this->token, $notifiable);
$vars = [
'name' => $notifiable->name,
'url' => $url,
'app_name' => config('app.name'),
'expire_minutes' => config('auth.passwords.users.expire'),
];
return (new MailMessage)
->subject($template->renderSubject($vars))
->view('notifications.mail-template', [
'body' => $template->renderBody($vars),
]);
}
}