Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Use default Slack colors, add warning color #16345

Merged
merged 1 commit into from
Nov 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/Illuminate/Notifications/Messages/SlackMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class SlackMessage
{
/**
* The "level" of the notification (info, success, error).
* The "level" of the notification (info, success, error, warning).
*
* @var string
*/
Expand Down Expand Up @@ -79,6 +79,18 @@ public function error()
return $this;
}

/**
* Indicate that the notification gives information about a warning.
*
* @return $this
*/
public function warning()
{
$this->level = 'warning';

return $this;
}

/**
* Set a custom user icon for the Slack message.
*
Expand Down Expand Up @@ -147,9 +159,11 @@ public function color()
{
switch ($this->level) {
case 'success':
return '#7CD197';
return 'good';
case 'error':
return '#F35A00';
return 'danger';
case 'warning':
return 'warning';
}
}

Expand Down