Skip to content

Commit cd4960b

Browse files
author
Kenneth
committed
Support for image_url property within Slack attachments
1 parent 77860a8 commit cd4960b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Illuminate/Notifications/Channels/SlackWebhookChannel.php

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ protected function attachments(SlackMessage $message)
8989
'footer' => $attachment->footer,
9090
'footer_icon' => $attachment->footerIcon,
9191
'ts' => $attachment->timestamp,
92+
'image_url' => $attachment->imageUrl,
9293
]);
9394
})->all();
9495
}

src/Illuminate/Notifications/Messages/SlackAttachment.php

+21
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ class SlackAttachment
7676
*/
7777
public $timestamp;
7878

79+
/**
80+
* The attachment's image url.
81+
*
82+
* @var string
83+
*/
84+
public $imageUrl;
85+
7986
/**
8087
* Set the title of the attachment.
8188
*
@@ -218,4 +225,18 @@ public function timestamp(Carbon $timestamp)
218225

219226
return $this;
220227
}
228+
229+
/**
230+
* Set the image url.
231+
*
232+
* @param string $url
233+
*
234+
* @return $this
235+
*/
236+
public function imageUrl($url)
237+
{
238+
$this->imageUrl = $url;
239+
240+
return $this;
241+
}
221242
}

0 commit comments

Comments
 (0)