complete story 8.2 with qa tests

This commit is contained in:
Naser Mansour
2025-12-29 00:58:36 +02:00
parent 911624901f
commit d1016c89f8
7 changed files with 432 additions and 84 deletions
@@ -2,9 +2,11 @@
namespace App\Notifications;
use App\Mail\WelcomeEmail;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Mail\Mailable;
use Illuminate\Notifications\Notification;
class WelcomeAccountNotification extends Notification implements ShouldQueue
@@ -29,17 +31,11 @@ class WelcomeAccountNotification extends Notification implements ShouldQueue
/**
* Get the mail representation of the notification.
*/
public function toMail(object $notifiable): MailMessage
public function toMail(object $notifiable): Mailable
{
$locale = $notifiable->preferred_language ?? 'ar';
return (new MailMessage)
->subject(__('emails.welcome_subject', [], $locale))
->view('emails.welcome', [
'user' => $notifiable,
'password' => $this->password,
'locale' => $locale,
]);
/** @var User $notifiable */
return (new WelcomeEmail($notifiable, $this->password))
->to($notifiable->email);
}
/**