PHP code example of verifiedjoseph / gotify-api-php

1. Go to this page and download the library: Download verifiedjoseph/gotify-api-php 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/ */

    

verifiedjoseph / gotify-api-php example snippets




use Gotify\Server;
use Gotify\Auth\Token;
use Gotify\Endpoint\Message;

// Set server
$server = new Server('https://gotify.example.com/');

// Set application token
$auth = new Token('ApplicationTokenHere');

// Create a message class instance
$message = new Message($server, $auth);

// Send a message
$message->create(
  title: 'hello?',
  message: 'Hello World',
  priority: Message::PRIORITY_HIGH,
);

composer