shimomo / laravel-ping
Ping for Laravel.
Installs: 3 560
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 5
Open Issues: 1
Requires
- php: >=7.0.0
- geerlingguy/ping: ^1.0.0
- illuminate/support: ^5.0.0
Requires (Dev)
- phpunit/phpunit: ^6.0.0
- satooshi/php-coveralls: ^1.0.0
README
Installation
Install via Composer.
$ composer require shimomo/laravel-ping
Add to config/app.php
.
<?php return [ // ... 'providers' => [ // ... Shimomo\Laravel\PingServiceProvider::class, ], // ... 'aliases' => [ // ... 'Ping' => Shimomo\Laravel\PingFacade::class, ], ];
Usage
<?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; /** * @author shimomo */ class PingController extends Controller { /** * @return string */ public function execute() { if ($latency = \Ping::execute('https://example.com/')) { return $latency . 'ms'; } return 'Not exist.'; } }
License
Laravel Ping is open-sourced software licensed under the MIT license.