Download the PHP package cego/service-health-checking without Composer
On this page you can find all versions of the php package cego/service-health-checking. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cego/service-health-checking
More information about cego/service-health-checking
Files in cego/service-health-checking
Package service-health-checking
Short Description A package containing a generic health check endpoint designed with expansion in mind
License MIT
Informations about the package service-health-checking
Service Health Checking
This package contains core functionality for HTTP health checking of Laravel services.
Usage
When the package is installed, a health endpoint, /vendor/service-health-checking
is exposed. The endpoint
returns 200 OK
and a body with a JSON data object with the following format:
The checks
array contains an entry for each registered health check.
Creating health checks
To create a health check for your service, simply create a class that extends
\Cego\ServiceHealthChecking\BaseHealthCheck
. The base method has 2 abstract methods:
check(): HealthStatus
should perform the check and return aHealthStatus
object.getDescription(): string
should return a description of the health check.
Registering health checks
Firstly, publish the package assets by running:
The package will publish a config file, service-health-checking.php
, in which health check classes must be
registered, in order for them to run. The package is shipped with a basic database connection check, which is registered
by default.
All versions of service-health-checking with dependencies
illuminate/http Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0
ext-json Version *