PHP code example of letsgoi / laravel-health-check

1. Go to this page and download the library: Download letsgoi/laravel-health-check 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/ */

    

letsgoi / laravel-health-check example snippets


'providers' => [
    // ...
    Letsgoi\HealthCheck\HealthCheckServiceProvider::class,
];

'checkers' => [
    ...
    Letsgoi\HealthCheck\Checkers\DatabaseConnectionChecker::class,
    Letsgoi\HealthCheck\Checkers\WritablePathsChecker::class,
    ...
],

use Letsgoi\HealthCheck\Facades;

HealthCheck::check(new Checker());

use Letsgoi\HealthCheck\Facades;

HealthCheck::healthCheck();

use Letsgoi\HealthCheck\Facades;

HealthCheck::getCheckErrors();

...

'endpoint' => [
    'enabled' => env('HEALTH_CHECK_ENDPOINT_ENABLED', true), // Enable/disable endpoint

    'path' => env('HEALTH_CHECK_ENDPOINT_PATH', '/health-check'), // Configure path of endpoint

    'healthy_message' => env('HEALTH_CHECK_ENDPOINT_HEALTHY_MESSAGE', 'Healthy'), // Set ok message
],

...
bash
php artisan vendor:publish --provider="Letsgoi\HealthCheck\HealthCheckServiceProvider" --tag="config"
bash
php artisan health-check