diff --git a/src/Facades/Notification.php b/src/Facades/Notification.php index 5cb78169..29013fb8 100644 --- a/src/Facades/Notification.php +++ b/src/Facades/Notification.php @@ -7,6 +7,8 @@ /** * @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 578d860e..1edf0c46 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -14,6 +14,10 @@ class Notification protected string $event = ''; + protected string $sound = ''; + + protected bool $silent = false; + private bool $hasReply = false; private string $replyPlaceholder = ''; @@ -51,6 +55,20 @@ public function event(string $event): self return $this; } + public function sound(string $sound): self + { + $this->sound = $sound; + + return $this; + } + + public function silent(bool $silent = true): self + { + $this->silent = $silent; + + return $this; + } + public function hasReply(string $placeholder = ''): self { $this->hasReply = true; @@ -80,6 +98,8 @@ public function show(): self 'title' => $this->title, 'body' => $this->body, 'event' => $this->event, + 'sound' => $this->sound, + 'silent' => $this->silent, 'hasReply' => $this->hasReply, 'replyPlaceholder' => $this->replyPlaceholder, 'actions' => array_map(fn (string $label) => [