| Package Data | |
|---|---|
| Maintainer Username: | karlmonson |
| Maintainer Contact: | karl@karlmonson.com (Karl Monson) |
| Package Create Date: | 2016-07-21 |
| Package Last Update: | 2023-06-15 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-26 03:01:05 |
| Package Statistics | |
|---|---|
| Total Downloads: | 38,081 |
| Monthly Downloads: | 269 |
| Daily Downloads: | 1 |
| Total Stars: | 29 |
| Total Watchers: | 3 |
| Total Forks: | 22 |
| Total Open Issues: | 1 |
This Laravel package is simple and unopinionated. It simply returns the HTTP Status Code for a provided URL.
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,
];
<?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 :(';
}
}
}
The MIT License (MIT). Please see License File for more information.