From 9495d36382e347c23134bc516dc22b0aabc4501b Mon Sep 17 00:00:00 2001 From: Jibbe Winands Date: Fri, 17 Oct 2025 14:39:04 +0200 Subject: [PATCH 1/2] Add sound property and method to Notification class --- src/Facades/Notification.php | 1 + src/Notification.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/Facades/Notification.php b/src/Facades/Notification.php index 5cb78169..f8b74dc0 100644 --- a/src/Facades/Notification.php +++ b/src/Facades/Notification.php @@ -7,6 +7,7 @@ /** * @method static static title(string $title) * @method static static event(string $event) + * @method static static sound(string $sound) * @method static static message(string $body) * @method static static reference(string $reference) * @method static static hasReply(string $placeholder = '') diff --git a/src/Notification.php b/src/Notification.php index 578d860e..1f116716 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -14,6 +14,8 @@ class Notification protected string $event = ''; + protected string $sound = ''; + private bool $hasReply = false; private string $replyPlaceholder = ''; @@ -51,6 +53,13 @@ public function event(string $event): self return $this; } + public function sound(string $sound): self + { + $this->sound = $sound; + + return $this; + } + public function hasReply(string $placeholder = ''): self { $this->hasReply = true; @@ -80,6 +89,7 @@ public function show(): self 'title' => $this->title, 'body' => $this->body, 'event' => $this->event, + 'sound' => $this->sound, 'hasReply' => $this->hasReply, 'replyPlaceholder' => $this->replyPlaceholder, 'actions' => array_map(fn (string $label) => [ From c827e3285c72c9282f82f0cf28559aefa363389f Mon Sep 17 00:00:00 2001 From: Jibbe Winands Date: Fri, 17 Oct 2025 14:51:16 +0200 Subject: [PATCH 2/2] Add silent property and method to Notification class --- src/Facades/Notification.php | 1 + src/Notification.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/Facades/Notification.php b/src/Facades/Notification.php index f8b74dc0..29013fb8 100644 --- a/src/Facades/Notification.php +++ b/src/Facades/Notification.php @@ -8,6 +8,7 @@ * @method static static title(string $title) * @method static static event(string $event) * @method static static sound(string $sound) + * @method static static silent(bool $silent = true) * @method static static message(string $body) * @method static static reference(string $reference) * @method static static hasReply(string $placeholder = '') diff --git a/src/Notification.php b/src/Notification.php index 1f116716..1edf0c46 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -15,6 +15,8 @@ class Notification protected string $event = ''; protected string $sound = ''; + + protected bool $silent = false; private bool $hasReply = false; @@ -60,6 +62,13 @@ public function sound(string $sound): self return $this; } + public function silent(bool $silent = true): self + { + $this->silent = $silent; + + return $this; + } + public function hasReply(string $placeholder = ''): self { $this->hasReply = true; @@ -90,6 +99,7 @@ public function show(): self 'body' => $this->body, 'event' => $this->event, 'sound' => $this->sound, + 'silent' => $this->silent, 'hasReply' => $this->hasReply, 'replyPlaceholder' => $this->replyPlaceholder, 'actions' => array_map(fn (string $label) => [