userId = $userId; $this->upload = $upload; $this->download = $download; $this->total = $total; } public function via($notifiable) { return sysConfig('data_anomaly_notification'); } public function toMail($notifiable): MailMessage { return (new MailMessage) ->subject(trans('notification.data_anomaly')) ->line(trans('notification.data_anomaly_content', ['id' => $this->userId, 'upload' => $this->upload, 'download' => $this->download, 'total' => $this->total])); } public function toCustom($notifiable): array { return [ 'title' => trans('notification.data_anomaly'), 'content' => trans('notification.data_anomaly_content', ['id' => $this->userId, 'upload' => $this->upload, 'download' => $this->download, 'total' => $this->total]), ]; } public function toTelegram($notifiable): TelegramMessage { return TelegramMessage::create() ->token(sysConfig('telegram_token')) ->content(trans('notification.data_anomaly_content', ['id' => $this->userId, 'upload' => $this->upload, 'download' => $this->download, 'total' => $this->total])); } }