diff --git a/src/Illuminate/Notifications/Channels/SlackWebhookChannel.php b/src/Illuminate/Notifications/Channels/SlackWebhookChannel.php index 5f4428af0af4..d2dd7ff46b8c 100644 --- a/src/Illuminate/Notifications/Channels/SlackWebhookChannel.php +++ b/src/Illuminate/Notifications/Channels/SlackWebhookChannel.php @@ -59,6 +59,7 @@ protected function buildJsonPayload(SlackMessage $message) 'icon_emoji' => data_get($message, 'icon'), 'icon_url' => data_get($message, 'image'), 'channel' => data_get($message, 'channel'), + 'link_names' => data_get($message, 'linkNames'), ]); return array_merge([ diff --git a/src/Illuminate/Notifications/Messages/SlackMessage.php b/src/Illuminate/Notifications/Messages/SlackMessage.php index d4a61be882b1..bf01a4e70ae1 100644 --- a/src/Illuminate/Notifications/Messages/SlackMessage.php +++ b/src/Illuminate/Notifications/Messages/SlackMessage.php @@ -48,6 +48,13 @@ class SlackMessage */ public $content; + /** + * Linkify channel names and usernames. + * + * @var bool + */ + public $linkNames = 0; + /** * The message's attachments. * @@ -98,6 +105,18 @@ public function error() return $this; } + /** + * Find and link channel names and usernames. + * + * @return $this + */ + public function linkNames() + { + $this->linkNames = 1; + + return $this; + } + /** * Set a custom username and optional emoji icon for the Slack message. *