data = $data; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return [ 'slack' ]; } /** * Format slack notification * * @param mixed $notifiable * @return SlackMessage */ public function toSlack($notifiable) { $data = $this->data; return (new SlackMessage) ->warning() ->attachment(function ($attachment) use ($data) { $attachment->title('Speedtest Daily Overview') ->fields([ 'Average ping' => $data['ping'] . ' ms', 'Average download' => $data['download'] . ' Mbit/s', 'Average upload' => $data['upload'] . ' Mbit/s', ]); }); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ // ]; } }