Skip to content

PHP library for interacting with a Gotify server using the Gotify REST-API

License

Notifications You must be signed in to change notification settings

VerifiedJoseph/gotify-api-php

Repository files navigation

gotify-api-php

Latest Version Software License

PHP library for interacting with a Gotify server using the Gotify REST-API.

Supports Gotify server version 2.5 or newer.

Install

composer require verifiedjoseph/gotify-api-php

Quick Start

require __DIR__ . '/vendor/autoload.php';

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,
);

Documentation

Requirements

  • PHP >= 8.2
  • Composer
  • PHP Extensions:

Dependencies

guzzlehttp/guzzle

Changelog

All notable changes to this project are documented in the CHANGELOG.

License

MIT License. Please see LICENSE for more information.