*/ public function via(object $notifiable): array { return ['database', 'mail']; } /** * Get the mail representation of the notification. */ public function toMail(object $notifiable): MailMessage { return (new MailMessage()) ->subject("SSO Support Ticket Raised: {$this->ticket->ticket_id}") ->greeting('Hello,') ->line("A new support ticket has been raised regarding {$this->ticket->issue_category}.") ->line('Ticket ID: '.$this->ticket->ticket_id) ->line('Raised By: '.$this->ticket->user->name) ->line('Description: '.($this->ticket->description ?? 'N/A')) ->action('View Ticket Details', route('tickets.index')) ->line('Thank you for using our application!'); } /** * Get the array representation of the notification. * * @return array */ public function toArray(object $notifiable): array { $appName = $this->ticket->connectedApp->name ?? 'General Inquiry'; return [ 'ticket_id' => $this->ticket->id, 'ticket_code' => $this->ticket->ticket_id, 'user_name' => $this->ticket->user->name, 'issue_category' => $this->ticket->issue_category, 'app_name' => $appName, 'description' => Str::limit($this->ticket->description ?? '', 100), 'message' => "New ticket {$this->ticket->ticket_id} raised by {$this->ticket->user->name} ({$appName}).", ]; } }