Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Facades/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '')
Expand Down
20 changes: 20 additions & 0 deletions src/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class Notification

protected string $event = '';

protected string $sound = '';

protected bool $silent = false;

private bool $hasReply = false;

private string $replyPlaceholder = '';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) => [
Expand Down