1. Go to this page and download the library: Download petecoop/gotify library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Petecoop\Gotify\Facades\Gotify;
Gotify::message('Version 2 is live.')
->title('Deployment complete')
->highPriority()
->send();
Gotify::message('Version 2 is live.')
->title('Deployment complete')
->queue();
Gotify::message('Version 2 is live.')
->queue(connection: 'redis', queue: 'developer-alerts');
use Petecoop\Gotify\GotifyMessage;
use Illuminate\Notifications\Notification;
class AccountApproved extends Notification
{
public function via(object $notifiable): array
{
return ['gotify'];
}
public function toGotify(object $notifiable): GotifyMessage
{
return GotifyMessage::make('The invoice has been paid.')
->title('Invoice paid')
->lowPriority()
->url('http://example.com/invoices');
}
}
use Illuminate\Notifications\Notification;
// On your User model (or another notifiable model)
public function routeNotificationForGotify(Notification $notification): string|false|null
{
return $this->receives_gotify_notifications
? $this->gotify_token
: false;
}
public function routeNotificationForGotify(Notification $notification): array
{
return [
'url' => $this->gotify_url,
'token' => $this->gotify_token,
];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.