%PDF- %PDF-
Direktori : /var/www/html/news/app/Notifications/ |
Current File : /var/www/html/news/app/Notifications/SendMailNotification.php |
<?php namespace App\Notifications; use App\Models\Notification as MailNotification; use App\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; class SendMailNotification extends Notification { use Queueable; /** * @var User */ private $user; /** * @var Notification */ private $notification; /** * Create a new notification instance. * @param User $user * @param MailNotification $notification */ public function __construct(User $user, MailNotification $notification) { $this->user = $user; $this->notification = $notification; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return ['mail']; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { return (new MailMessage)->subject($this->notification->subject) ->greeting($this->notification->greeting . $this->user->present()->fullName) ->line($this->notification->body) ->line($this->notification->thank_you); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ // ]; } }