From 68b5bafd082cf70f9bd4d83d9c9e035e8ccd08bb Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Thu, 10 Nov 2016 14:18:12 +0100 Subject: [PATCH] Use default Slack colors, add warning color --- .../Notifications/Messages/SlackMessage.php | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Notifications/Messages/SlackMessage.php b/src/Illuminate/Notifications/Messages/SlackMessage.php index f0cf2a095ba0..4cd5b7dc15b1 100644 --- a/src/Illuminate/Notifications/Messages/SlackMessage.php +++ b/src/Illuminate/Notifications/Messages/SlackMessage.php @@ -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 */ @@ -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. * @@ -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'; } }