2017 © Pedro Peláez
 

library ping-sdk

image

my-monitor/ping-sdk

  • Monday, January 29, 2018
  • by ahmedash95
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 50 % Grown

The README.md

PingSdk

this is a simple package to use uptime service in MyMonitor/Servers-Mointor project, (*1)

Usage

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)

Installation

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 Support

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');

Credits

License

The MIT License (MIT). Please see License File for more information., (*13)

The Versions