PHP code example of redwebcreation / laravel-healthful
1. Go to this page and download the library: Download redwebcreation/laravel-healthful 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/ */
redwebcreation / laravel-healthful example snippets
use RWC\Healthful\Checks\DatabaseCheck;
use RWC\Healthful\Checks\QueueCheck;
use RWC\Healthful\Checks\SchedulerCheck;
return [
/* The route that should return the health status */
'route' => '/_/health',
/* A list of checks to be performed. */
'checks' => [
DatabaseCheck::class,
]
];
use RWC\Healthful\Facades\Health;
Health::check();
use RWC\Healthful\Facades\Health;
Health::route()->name('healthcheck');
// app/HealthChecks/IsMondayCheck.php
use RWC\Healthful\Checks\Check;
class IsMondayCheck implements Check {
public function passes() : bool{
// Monday is never healthful.
return !now()->isMonday();
}
}