*/ public function via(object $notifiable): array { return ['database', 'mail']; } public function toMail(object $notifiable): MailMessage { $employee = $this->report->employee; return (new MailMessage) ->subject('New Disciplinary Report Created') ->line("A new disciplinary report has been created for {$employee->full_name}.") ->line("Title: {$this->report->title}") ->line("Severity: {$this->report->severity->label()}") ->line("Date: {$this->report->report_date->toDateString()}"); } /** * @return array */ public function toArray(object $notifiable): array { return [ 'report_id' => $this->report->id, 'employee_id' => $this->report->employee_id, 'employee_name' => $this->report->employee->full_name, 'title' => $this->report->title, 'severity' => $this->report->severity->value, 'report_date' => $this->report->report_date->toDateString(), 'created_by' => $this->report->created_by, ]; } }