ticket = $ticket; $this->user = $user; $this->newmessage = $newmessage; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { $via = ['mail', 'database']; return $via; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return MailMessage */ public function toMail($notifiable) { return (new MailMessage) ->subject('[Ticket ID: '.$this->ticket->ticket_id.'] '.$this->ticket->title) ->markdown('mail.ticket.user.reply', ['ticket' => $this->ticket, 'user' => $this->user, 'newmessage' => $this->newmessage]); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ 'title' => '[Ticket ID: '.$this->ticket->ticket_id.'] '.$this->ticket->title, 'content' => "

Ticket With ID : {$this->ticket->ticket_id} A response has been added to your ticket. Please see below for our response!


Message:

{$this->newmessage}

", ]; } }