shimomo / laravel-ping by shimomo

Ping for Laravel.
3,560
3
2
Package Data
Maintainer Username: shimomo
Package Create Date: 2017-01-14
Package Last Update: 2017-05-19
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-19 03:11:30
Package Statistics
Total Downloads: 3,560
Monthly Downloads: 9
Daily Downloads: 0
Total Stars: 3
Total Watchers: 2
Total Forks: 5
Total Open Issues: 1

Laravel Ping

Build Status Coverage Status Latest Stable Version Total Downloads Dependency Status MIT License

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.