*/ public function via(object $notifiable): array { return ['database', 'mail']; } public function toMail(object $notifiable): MailMessage { return (new MailMessage) ->subject(__('notifications.employee_terminated.subject')) ->line(__('notifications.employee_terminated.line_terminated', [ 'name' => $this->employee->full_name, 'number' => $this->employee->employee_number, ])) ->line(__('notifications.employee_terminated.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, ]; } }