Skip to content

Commit b434e87

Browse files
committed
If false is returned in toWebsms() method from the notification, sending will be aborted!
1 parent 8aef787 commit b434e87

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Channels/WebSmsChannel.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(Client $client)
3636
* @param mixed $notifiable
3737
* @param \Illuminate\Notifications\Notification $notification
3838
*
39-
* @return Response
39+
* @return Response|null
4040
*
4141
* @throws \WebSms\Exception\ApiException
4242
* @throws \WebSms\Exception\AuthorizationFailedException
@@ -55,6 +55,10 @@ public function send($notifiable, Notification $notification)
5555
$to = Arr::wrap($to);
5656

5757
$message = $notification->toWebsms($notifiable);
58+
// If false is returned from notification, sending will be aborted!
59+
if ($message === false) {
60+
return null;
61+
}
5862
if (is_string($message)) {
5963
$message = new TextMessage($to, trim($message));;
6064
}

0 commit comments

Comments
 (0)