Download the PHP package petecoop/gotify without Composer
On this page you can find all versions of the php package petecoop/gotify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download petecoop/gotify
More information about petecoop/gotify
Files in petecoop/gotify
Package gotify
Short Description Gotify notifications channel for Laravel
License MIT
Homepage https://github.com/petecoop/laravel-gotify
Informations about the package gotify
Gotify Notifications Channel for Laravel
This package makes it easy to send notifications using Gotify with Laravel.
Contents
- Installation
- Setting up your Gotify application
- Usage
- Direct messages
- Laravel Notifications
- Available Message methods
- Per-user credentials
- Changelog
- Testing
- Security
- License
Installation
You can install the package via composer:
Setting up your Gotify Application
Create an application in your Gotify Server add the following to your config/services.php:
Usage
Direct messages
Use the facade to build and immediately send a message using the default Gotify configuration:
Call queue() instead to dispatch a generic queued job. The message payload is
serialized without the Gotify credentials; the job resolves the configured
client when it runs:
An optional connection and queue may be selected with named arguments:
Laravel Notifications
With Laravel Notifications you can use the channel in your via() method, and then define a toGotify() method to build the message:
See Per-user credentials below for how to send to different Gotify servers or applications per user.
Do not call send() or queue() on the message returned by toGotify();
Laravel's notification channel handles its delivery. Both methods report this
with a descriptive exception if called on a notification message.
Available Message methods
| Method | Description |
|---|---|
title($title) |
Set the title of the notification. |
message($message) |
Set the message body of the notification. |
url($url) |
Set the URL to open when the notification is clicked. |
image($url) |
Set the image URL to display in the notification. |
androidIntent($url) |
Set the Android intent to open when the notification is received. |
plainText() |
Set the message format to plain text. (Default) |
markdown() |
Set the message format to markdown. |
priority($priority) |
Set the priority of the notification. (0-10) Defaults to 5. |
lowestPriority() or withoutNotification() |
Set the priority to 0. |
lowPriority() |
Set the priority to 2. |
normalPriority() |
Set the priority to 5. (Default) |
highPriority() |
Set the priority to 8. |
highestPriority() or emergency() |
Set the priority to 10. |
extras($extras) |
Set any additional extras for the notification. |
gotifyUrl($url) |
Override the configured Gotify server URL for this message. |
token($token) |
Override the configured Gotify application token for this message. |
send() |
Immediately send a message created through Gotify::message(). |
queue($connection, $queue) |
Queue such a message, optionally selecting its connection and queue. |
Per-user credentials
By default, the channel uses the URL and application token in
services.gotify. This is convenient when Gotify is only used for a single
recipient, such as developer or administrator notifications.
Because each Gotify application token delivers to its owner's clients, a
notifiable can override the token on a per-user basis by implementing
routeNotificationForGotify:
Return an array when the user also needs a different Gotify server:
The URL and token are independently optional in the array: a missing or null
value falls back to the matching value in services.gotify.
Return false to explicitly skip Gotify delivery for that
notifiable.
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
All versions of gotify with dependencies
illuminate/bus Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/notifications Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0