*/ 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 Assigned: {$this->ticket->ticket_id}") ->greeting('Hello,') ->line("You have been assigned as the support owner for ticket {$this->ticket->ticket_id} regarding {$this->ticket->issue_category}.") ->line('Customer: '.$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' => "You have been assigned to ticket {$this->ticket->ticket_id} by the administrator.", ]; } }