Wallogit.com
2017 © Pedro Peláez
this is a simple package to use uptime service in MyMonitor/Servers-Mointor project, (*1)
to ping any service just use the PingSdkFacade class like below example, (*2)
// $images->optimize();
\MyMonitor\PingSdk\PingSdkFacade::ping('<Ping Key>');
Note: it will throw an HttpNotFoundException if the Ping Key is not valid, (*3)
You can install this package via composer using this command:, (*4)
composer require my-monitor/ping-sdk
then in app.php provideres array add service provider, (*5)
//
MyMonitor\PingSdk\PingSdkServiceProvider::class,
You can publish the config-file with:, (*6)
php artisan vendor:publish --provider="MyMonitor\PingSdk\PingSdkServiceProvider::class"
This is the contents of the published config file:, (*7)
<?php
return [
'api_endpoint' => env('PINGSDK_API_ENDPOINT',null),
'api_token' => env('PINGSDK_API_TOKEN',null),
];
Lumen configuration is slightly more involved but features and API are identical to Laravel., (*8)
Install using this command:, (*9)
composer require my-monitor/ping-sdk
Uncomment the following lines in the bootstrap file or add them if missing:, (*10)
// bootstrap/app.php: $app->withFacades(); $app->withEloquent();
Configure the pacakge service provider, (*11)
// bootstrap/app.php: $app->register(MyMonitor\PingSdk\PingSdkServiceProvider::class);
Finally, update boostrap/app.php to load the config file:, (*12)
// bootstrap/app.php
$app->configure('mymonitor-ping');
The MIT License (MIT). Please see License File for more information., (*13)