errors = $errors; } /** * 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) { $msg = NotificationsHelper::formatAbsoluteThresholdMessage($this->errors); return (new SlackMessage) ->warning() ->attachment(function ($attachment) use ($msg) { $attachment->title('Speedtest absolute threshold error') ->content($msg); }); } }