Skip to content

Commit

Permalink
Use default Slack colors, add warning color
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Nov 10, 2016
1 parent 2febb2c commit 68b5baf
Showing 1 changed file with 17 additions and 3 deletions.
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

0 comments on commit 68b5baf

Please sign in to comment.