data = $data; } public function via($notifiable) { return sysConfig('node_offline_notification'); } public function toMail($notifiable) { return (new MailMessage) ->subject(trans('notification.node_offline')) ->markdown('mail.simpleMarkdown', ['title' => trans('notification.node_offline_content'), 'content' => $this->markdownMessage(), 'url' => route('admin.node.index')]); } private function markdownMessage() { $content = ''; foreach ($this->data as $node) { $content .= "- {$node['name']} {$node['host']}\r\n"; } return $content; } public function toCustom($notifiable) { return [ 'title' => trans('notification.node_offline'), 'content' => $this->markdownMessage(), ]; } public function toBark($notifiable) { return [ 'title' => trans('notification.node_offline'), 'content' => $this->stringMessage(), ]; } private function stringMessage() { $content = ''; foreach ($this->data as $node) { $content .= "{$node['name']} {$node['host']}| "; } return $content; } }