title = $title; $this->content = $content; } public function via($notifiable): array { return $notifiable ?? ['mail', BarkChannel::class, TelegramChannel::class]; } public function toMail($notifiable): MailMessage { return (new MailMessage) ->subject($this->title) ->markdown('mail.custom', ['content' => $this->content]); } public function toCustom($notifiable): array { return [ 'title' => $this->title, 'content' => $this->content, ]; } public function toTelegram($notifiable): TelegramMessage { return TelegramMessage::create() ->token(sysConfig('telegram_token')) ->content($this->content); } public function toBark($notifiable): array { return [ 'title' => $this->title, 'content' => $this->content, 'group' => '自定义信息', 'icon' => asset('assets/images/notification/custom.png'), 'sound' => 'newmail', 'url_type' => 'markdown', ]; } }