PHP code example of pragmarx / health

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

    

pragmarx / health example snippets

 php
$generalHealthState = app('pragmarx.health')->checkResources();

// or

$databaseHealthy = app('pragmarx.health')->checkResource('database')->isHealthy();

Artisan::command('database:health', function () {
    app('pragmarx.health')->checkResource('database')->isHealthy()
        ? $this->info('database is healthy')
        : $this->info('database is in trouble')
    ;
})->describe('Check database health');