Healthchecks.io is a service that monitors your cron jobs and alerts you when they are down. This package is a wrapper for the Healthchecks.io API.
You can install the package via composer:
composer require bowero/laravel-healthchecks
You then need to publish the configuration file:
php artisan vendor:publish --tag="laravel-healthchecks-config"
This is the contents of the published config file:
return [
/*
* The URL endpoint of healthchecks.io
*/
'url' => 'https://hc-ping.com/',
/*
* Your registered jobs
*/
'jobs' => [
'my-first-check' => [
'uuid' => 'c2c0be0a-94fa-4128-aa8a-cd55889cdb29',
],
],
];
That's it! you can now use the package in your Laravel application. It is automatically registered in your service provider.
use Bowero\Healthchecks\Facades\Healthchecks;
/*
* Create a job
* (the job is registered in healthchecks.php)
*/
$job = Healthchecks::job('my-first-check');
/*
* Create a job based on the uuid
*/
$job = Healthchecks::uuid('c2c0be0a-94fa-4128-aa8a-cd55889cdb29');
/*
* Mark the job as started
*/
$job->start();
/*
* Mark the job as succesful
*/
$job->success();
/*
* Mark the job as failed
*/
$job->failure();
/*
* Mark the job as exited with a status code
*/
$job->exitWithStatus(1);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.