From 9b9fa7ddd4bd8b13ada6ca43362f592afc05fc91 Mon Sep 17 00:00:00 2001 From: catalin Date: Tue, 5 Apr 2022 10:22:54 +0300 Subject: [PATCH 1/2] via toPushed you can decided if a user is notified by it's settings or other business. When toPushed will return null, no message will be sent --- src/PushedChannel.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PushedChannel.php b/src/PushedChannel.php index cb73288..3e0c402 100644 --- a/src/PushedChannel.php +++ b/src/PushedChannel.php @@ -17,6 +17,8 @@ public function send($notifiable, Notification $notification) { $message = $notification->toPushed($notifiable); - $this->pushed->send($message->payload()); + if ($message) { + $this->pushed->send($message->payload()); + } } } From 10981531f280ec14faa9269dd73b4511060c5de3 Mon Sep 17 00:00:00 2001 From: catalin Date: Tue, 5 Apr 2022 12:19:57 +0300 Subject: [PATCH 2/2] fix method signature in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ababb59..2c09713 100755 --- a/README.md +++ b/README.md @@ -84,8 +84,8 @@ public function toPushed($notifiable) - `setUrl($url)`: (string) adds a URL action to the notification - `toApp()`: sends the notification to all users registered to your app - `toChannel($alias)`: (string) sends the notification to a given channel alias -- `toUser($accessToken)`: (string) sends the notification to a user that registered to your app using OAuth -- `toPushedId($pushedId)`: (string) sends the notification directly to a user's Pushed ID +- `toUser($accessToken, $alias)`: (string) sends the notification to a user that registered to your app using OAuth +- `toPushedId($pushedId, $alias)`: (string) sends the notification directly to a user's Pushed ID ## Testing