PHP code example of thecodingmachine / laravel-server-monitor-plugin-notification-by-host

1. Go to this page and download the library: Download thecodingmachine/laravel-server-monitor-plugin-notification-by-host 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/ */

    

thecodingmachine / laravel-server-monitor-plugin-notification-by-host example snippets


// config/app.php
'providers' => [
    ...
    TheCodingMachine\ServerMonitorPluginNotificationbyHost\ServerMonitorPluginNotificationByHostServiceProvider::class,
];

return [
    'notifications' => [
        /* List of each channel you can be used */
        /* This contain the detail of parameter mandatory to use it */
        'channels' => 
			['mail' => 
				['to' => 'array']],
			['slack' => 
				['webhook_url' => 'string']],
			
    ]
];

    ...

    'notifications' => [

        'notifications' => [
            TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifications\CheckSucceeded::class => [],
            TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifications\CheckRestored::class => ['slack'],
            TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifications\CheckWarning::class => ['slack'],
            TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifications\CheckFailed::class => ['slack'],
        ],
        ...
        'notifiable' => TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifiable::class,
        ...
    ]
    ...
bash
php artisan vendor:publish --provider="TheCodingMachine\ServerMonitorPluginNotificationbyHost\ServerMonitorPluginNotificationByHostServiceProvider" --tag="config"