diff --git a/src/Channels/SlackBotChannel.php b/src/Channels/SlackBotChannel.php index 0851398..6b1b3ef 100644 --- a/src/Channels/SlackBotChannel.php +++ b/src/Channels/SlackBotChannel.php @@ -3,10 +3,14 @@ namespace Slack\Channels; use Illuminate\Notifications\Notification; +use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Schema; class SlackBotChannel { - public function send($notifiable,Notification $notification) + private const LOGKEY = 'SBC'; + + public function send($notifiable,Notification $notification): void { if (! $co = $notifiable->routeNotificationFor('slackapp',$notification)) { return; @@ -15,6 +19,14 @@ class SlackBotChannel $o = $notification->toSlack($notifiable); $o->setChannel($co); - return $o->post(); + Log::debug(sprintf('%s:Sending Event to Channel [%s]',self::LOGKEY,$co->channel_id)); + + try { + $result = $o->post(); + + } catch (\Exception $e) { + Log::error(sprintf('Error posting to slack [%s]',$e->getMessage())); + return; + } } } \ No newline at end of file