*/ public function via(object $notifiable): array { return ['database', 'mail']; } public function toMail(object $notifiable): MailMessage { $employee = $this->vacation->employee; return (new MailMessage) ->subject('Vacation Request Approved') ->line("The vacation request for {$employee->full_name} has been approved.") ->line("Type: {$this->vacation->type->label()}") ->line("Dates: {$this->vacation->start_date->toDateString()} to {$this->vacation->end_date->toDateString()}") ->line("Days: {$this->vacation->days}"); } /** * @return array */ public function toArray(object $notifiable): array { return [ 'vacation_id' => $this->vacation->id, 'employee_id' => $this->vacation->employee_id, 'employee_name' => $this->vacation->employee->full_name, 'type' => $this->vacation->type->value, 'start_date' => $this->vacation->start_date->toDateString(), 'end_date' => $this->vacation->end_date->toDateString(), 'days' => $this->vacation->days, 'approved_by' => $this->vacation->approved_by, 'approved_at' => $this->vacation->approved_at?->toIso8601String(), ]; } }