1. Go to this page and download the library: Download 1gbits/hostdoctor-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
1gbits / hostdoctor-laravel example snippets
use OneGbits\HostDoctor\Facades\HostDoctor;
$report = HostDoctor::check('https://example.com');
$report->status; // "healthy" | "warning" | "degraded" | "critical"
$report->score; // 0–100
$report->issues; // Issue[] with stable machine-readable codes
$report->checks; // normalized per-check data
$report->toArray(); // full schema-shaped array
$report->toJson(); // same as JSON
if ($report->hasIssue('TLS_EXPIRING_SOON')) {
// alert someone
}
HostDoctor::check('https://api.example.com/health');
HostDoctor::check('example.com');
HostDoctor::check('203.0.113.10'); // network + ports only
HostDoctor::check('203.0.113.10:22'); // e.g. "is SSH up after provisioning?"
$this->app->instance('hostdoctor', $myFakeHostDoctor);
// or build one with fake probes:
new HostDoctor([], $fakeNetwork, $fakeTcp, $fakeTls, $fakeHttp, $policy);