karlmonson/laravel-ping
最新稳定版本:1.0.7
Composer 安装命令:
composer require karlmonson/laravel-ping
包简介
Simple Ping For Laravel Applications
README 文档
README
This Laravel package is simple and unopinionated. It simply returns the HTTP Status Code for a provided URL.
Installation
Install via Composer:
composer require karlmonson/laravel-ping
You'll need to register the ServiceProvider and Facade:
// config/app.php 'providers' => [ // ... Karlmonson\Ping\PingServiceProvider::class, ]; 'aliases' => [ // ... 'Ping' => Karlmonson\Ping\Facades\Ping::class, ];
Usage
<?php namespace App\Http\Controllers; use Ping; use App\Http\Controllers\Controller; class LinkController extends Controller { /** * Show the current health of a given URL. * * @param string $url * @return string */ public function healthCheck($url) { $health = Ping::check($url); if($health == 200) { return 'Alive!'; } else { return 'Dead :('; } } }
Credits
- Karl Monson - Author
- Eric Blount - Inspiration (ericmakesstuff/laravel-server-monitor)
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 38.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 29
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-21