actionType = $actionType; $this->model = $model; $this->message = $message; } /** * Get the notification's delivery channels. * * @return array */ public function via(object $notifiable): array { return ['mail', 'database']; } /** * Get the mail representation of the notification. */ public function toMail(object $notifiable): MailMessage { return (new MailMessage) ->subject('HR Notification') ->view('emails.email_template', [ 'actionType' => $this->actionType, 'model' => $this->model, ]); } /** * Get the array representation of the notification. * * @return array */ public function toArray(object $notifiable): array { return [ 'action_type' => $this->actionType, 'model' => $this->model, 'msg' => $this->message, ]; } }