brightfish/health-checks

Simple health checks for Laravel

0.8.1 2023-04-13 16:30 UTC

This package is auto-updated.

Last update: 2024-04-13 18:48:36 UTC


README

Tests Latest Version on Packagist Total Downloads

Usage

Run all your registered checks from the command line:

php artisan health:check

Or make a HTTP request to the built-in health endpoint:

curl GET https://your.app/health

Installation

Install the package with composer:

composer require brightfish/health-checks

Publish the config file:

php artisan vendor:publish --provider="Brightfish\HealthChecks\HealthServiceProvider" --tag="health-checks-config"

Create a custom health check class:

namespace App\Health\MyCustomCheck;

class MyCustomCheck extends \Brightfish\HealthChecks\Checks\AbstractCheck
{
    public function run(): bool
    {
        return false;
    }

    public function getMessage(): string
    {
        return 'Error';
    }
}

Finally, list up the class in the config file:

return [
    'checks' => [
        \App\Health\MyCustomCheck::class,
    ],
];

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

GNU General Public License (GPL). Please see License File for more information.