1. Go to this page and download the library: Download jtkalkman/laravel-health 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/ */
jtkalkman / laravel-health example snippets
use JTKalkman\LaravelHealth\HealthChecks\CpuLoadCheck;
use JTKalkman\LaravelHealth\HealthChecks\DatabaseConnectionCheck;
use JTKalkman\LaravelHealth\HealthChecks\DatabaseConnectionCountCheck;
use JTKalkman\LaravelHealth\HealthChecks\DiskSpaceCheck;
use JTKalkman\LaravelHealth\HealthChecks\DiskSpaceInodeCheck;
use JTKalkman\LaravelHealth\HealthChecks\MemoryCheck;
return [
/*
|--------------------------------------------------------------------------
| Health Check Route
|--------------------------------------------------------------------------
|
| The URI where the health endpoint will be accessible.
|
*/
'route' => env('HEALTH_ROUTE', '/health'),
/*
|--------------------------------------------------------------------------
| Authentication
|--------------------------------------------------------------------------
|
| The header name and value your monitoring tool sends with each request.
| Required, the endpoint will return 404 until this is set.
|
| When using Semonto, set the header name to match what you configured
| in your Semonto server health monitoring settings.
|
*/
'auth' => [
'health_check_header_name' => env('HEALTH_CHECK_HEADER_NAME', 'health-monitor-access-key'),
'health_check_secret' => env('HEALTH_CHECK_SECRET', null),
],
/*
|--------------------------------------------------------------------------
| HTTPS
|--------------------------------------------------------------------------
|
| When enabled, the health endpoint will only respond to HTTPS requests.
| Strongly recommended in production. Set to false for local development.
|
*/
'