diff --git a/app/Notifications/Channels/SmsChannel.php b/app/Notifications/Channels/SmsChannel.php index 5dc2c034..b20a111b 100644 --- a/app/Notifications/Channels/SmsChannel.php +++ b/app/Notifications/Channels/SmsChannel.php @@ -2,10 +2,9 @@ namespace App\Notifications\Channels; +use App\Notifications\Messages\SmsMessage; use Illuminate\Notifications\Notification; use Overtrue\EasySms\EasySms; -use Overtrue\EasySms\Exceptions\NoGatewayAvailableException; -use Overtrue\EasySms\Message; class SmsChannel { @@ -27,16 +26,10 @@ class SmsChannel $message = $notification->toSms($notifiable); $phone = $notifiable->routeNotificationFor('sms', $notification); - if (! $phone && ! $message instanceof Message) { + if (! $phone && ! $message instanceof SmsMessage) { return; } - try { - $this->easySms->send($phone, $message); - } catch (NoGatewayAvailableException $e) { - foreach ($e->getExceptions() as $exception) { - report($exception); - } - } + $this->easySms->send($phone, $message); } } diff --git a/app/Notifications/Messages/SmsMessage.php b/app/Notifications/Messages/SmsMessage.php new file mode 100644 index 00000000..d0868cf4 --- /dev/null +++ b/app/Notifications/Messages/SmsMessage.php @@ -0,0 +1,9 @@ +