PHP code example of f1ll0y / php-os-gui-notify
1. Go to this page and download the library: Download f1ll0y/php-os-gui-notify 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/ */
f1ll0y / php-os-gui-notify example snippets
use Joli\JoliNotif\Notification;
use Joli\JoliNotif\NotifierFactory;
// Create a Notifier
$notifier = NotifierFactory::create();
// Create your notification
$notification =
(new Notification())
->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 (AppleScriptNotifier)
->addOption('sound', 'Frog') // Only works on macOS (AppleScriptNotifier)
;
// Send it
$notifier->send($notification);