Skip to content

Commit

Permalink
Support for image_url property within Slack attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth committed Apr 4, 2017
1 parent 77860a8 commit cd4960b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ protected function attachments(SlackMessage $message)
'footer' => $attachment->footer,
'footer_icon' => $attachment->footerIcon,
'ts' => $attachment->timestamp,
'image_url' => $attachment->imageUrl,
]);
})->all();
}
Expand Down
21 changes: 21 additions & 0 deletions src/Illuminate/Notifications/Messages/SlackAttachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ class SlackAttachment
*/
public $timestamp;

/**
* The attachment's image url.
*
* @var string
*/
public $imageUrl;

/**
* Set the title of the attachment.
*
Expand Down Expand Up @@ -218,4 +225,18 @@ public function timestamp(Carbon $timestamp)

return $this;
}

/**
* Set the image url.
*
* @param string $url
*
* @return $this
*/
public function imageUrl($url)
{
$this->imageUrl = $url;

return $this;
}
}

0 comments on commit cd4960b

Please sign in to comment.