Ping for Laravel.

Ping for Laravel.

README

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' => [
        // ...
        ShimomoLaravelPingServiceProvider::class,
    ],

    // ...

    'aliases' => [
        // ...
        'Ping' => ShimomoLaravelPingFacade::class,
    ],
];

Usage

<?php

namespace AppHttpControllers;

use AppHttpControllersController;

/**
 * @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.

Source

Add a Comment

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *