complete story 8.2 with qa tests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user