bowero / laravel-healthchecks
A Laravel wrapper for healthchecks.io
Fund package maintenance!
Bowero
Requires
- php: ^8.0
- illuminate/contracts: ^9.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-11-09 06:39:22 UTC
README
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.
Installation
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.
Usage
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);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.