PHP code example of verifiedjoseph / ntfy-php-library

1. Go to this page and download the library: Download verifiedjoseph/ntfy-php-library 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 / ntfy-php-library example snippets




use Ntfy\Server;
use Ntfy\Message;
use Ntfy\Client;

$server = new Server('https://ntfy.sh/');

$message = new Message();
$message->topic('mytopic');
$message->title('Hello World');
$message->body('Hello World from ntfy.sh');
$message->priority(Message::PRIORITY_HIGH);

$client = new Client($server);
$client->send($message);

composer