PHP code example of xiebruce / php-notification

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

    

xiebruce / php-notification example snippets




use Notification\Notification;

// subtitle only supported on macOS.
$config = [
	'success' => [
		'title' => 'Upload succeed',
		'subtitle' => 'Upload succeed',
		'message' => 'You can paste url directly.',
	],
	'failed' => [
		'title' => 'Upload failed',
		'subtitle' => 'Upload failed',
		'message' => 'Sorry, Upload failed.',
	],
	'no_image' => [
		'title' => 'No image',
		'subtitle' => 'No image was dected on the clipboard',
		'message' => 'No image was detected on the clipboard, Please take a screenshot first.',
	],
];

$notify = new Notification($config);
$notify->send('success');
bash
composer