*/ public function via(object $notifiable): array { return ['database', 'mail']; } public function toMail(object $notifiable): MailMessage { return (new MailMessage) ->subject('Employee Terminated') ->line("{$this->employee->full_name} ({$this->employee->employee_number}) has been terminated.") ->line("Termination date: {$this->employee->termination_date?->toDateString()}"); } /** * @return array */ public function toArray(object $notifiable): array { return [ 'employee_id' => $this->employee->id, 'employee_number' => $this->employee->employee_number, 'full_name' => $this->employee->full_name, 'termination_date' => $this->employee->termination_date?->toDateString(), 'department_id' => $this->employee->department_id, ]; } }