complete 2.5 with qa tests

This commit is contained in:
Naser Mansour
2025-12-26 16:19:55 +02:00
parent f508f2b7bf
commit 1376f86d79
11 changed files with 601 additions and 2 deletions
@@ -0,0 +1,56 @@
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class WelcomeAccountNotification extends Notification implements ShouldQueue
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct(public string $password) {}
/**
* 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
{
$locale = $notifiable->preferred_language ?? 'ar';
return (new MailMessage)
->subject(__('emails.welcome_subject', [], $locale))
->view('emails.welcome', [
'user' => $notifiable,
'password' => $this->password,
'locale' => $locale,
]);
}
/**
* Get the array representation of the notification.
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
'type' => 'welcome_account',
];
}
}