You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Display desktop notifications from your PHP scripts.
JoliNotif is a cross-platform PHP library to display desktop notifications.
It works on Linux, Windows (WSL included) or macOS.
Requires PHP >= 8.2 (support for previous PHP versions was available in older releases of this library).
Note
This library can not be used in a web context (FPM or equivalent). Use
it in your CLI scripts or in a CRON
Installation
Use Composer to install JoliNotif in your project:
composer require "jolicode/jolinotif"
Usage
include__DIR__.'/vendor/autoload.php';
useJoli\JoliNotif\Notification;
useJoli\JoliNotif\DefaultNotifier;
$notifier = newDefaultNotifier();
// Create your notification$notification =
(newNotification())
->setTitle('Notification title')
->setBody('This is the body of your notification')
->setIcon(__DIR__.'/path/to/your/icon.png')
->addOption('subtitle', 'This is a subtitle') // Only works on macOS (AppleScriptDriver)
->addOption('sound', 'Frog') // Only works on macOS (AppleScriptDriver & TerminalNotifierDriver)
;
// Send it$notifier->send($notification);