Skip to content
Open
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
32 changes: 32 additions & 0 deletions resources/views/docs/desktop/2/the-basics/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,38 @@ Notification::title('Hello from NativePHP')
->show();
```

### Notification Sounds

You may set a custom audio by using the `sound()` method.

Setting a sound overrides the system's default notification sound for that notification.

You can use the system's default notification sounds. On macOS, for example, set the sound to `'Ping'`.

```php
Notification::title('Hello from NativePHP')
->sound('Ping')
->show();
```

You can also provide a custom audio file.

```php
Notification::title('Hello from NativePHP')
->sound(resource_path('example.mp3'))
->show();
```

### Silent Notifications

Make a notification silent with the `silent()` method:

```php
Notification::title('Hello from NativePHP')
->silent()
->show();
```

### Notification Actions

On macOS, you can add action buttons to a notification using the `addAction()` method.
Expand Down