/** * Format the message's attachments. * * @param \Illuminate\Notifications\Messages\SlackMessage $message * @return array */ protected function attachments(SlackMessage $message) { return collect($message->attachments)->map(function ($attachment) use($message) { return array_filter(['color' => $message->color(), 'title' => $attachment->title, 'text' => $attachment->content, 'title_link' => $attachment->url, 'fields' => $this->fields($attachment)]); })->all(); }
/** * Format the message's attachments. * * @param \Illuminate\Notifications\Messages\SlackMessage $message * @return array */ protected function attachments(SlackMessage $message) { return collect($message->attachments)->map(function ($attachment) use($message) { return array_filter(['color' => $attachment->color ?: $message->color(), 'title' => $attachment->title, 'text' => $attachment->content, 'title_link' => $attachment->url, 'fields' => $this->fields($attachment), 'mrkdwn_in' => $attachment->markdown, 'footer' => $attachment->footer, 'footer_icon' => $attachment->footerIcon, 'ts' => $attachment->timestamp]); })->all(); }