Skip to content

Commit

Permalink
fix: skip sending message when null returned
Browse files Browse the repository at this point in the history
  • Loading branch information
atymic committed Nov 12, 2019
1 parent f9feffd commit c1289b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/SmsBroadcastChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public function send($notifiable, Notification $notification): void
$message = new SmsBroadcastMessage($message);
}

if (! $message instanceof SmsBroadcastMessage) {
return;
}

$this->smsBroadcastClient->send(
$to,
$message->content,
Expand Down
2 changes: 1 addition & 1 deletion src/SmsBroadcastServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace NotificationChannels\SmsBroadcast;

use Atymic\SmsBroadcast\Api\Client;
use Illuminate\Support\ServiceProvider;
use Atymic\SmsBroadcast\Factory\ClientFactory;
use Illuminate\Support\ServiceProvider;

class SmsBroadcastServiceProvider extends ServiceProvider
{
Expand Down

0 comments on commit c1289b5

Please sign in to comment.