laravel_health_check maintained by meysam-znd
Description
By using this package you can monitor the health of your application
Author
Last update
2022/11/13 10:53
(dev-master)
License
Downloads
25
Tags
Laravel Health Check
Version Compatibility
| Releases | Laravel |
|---|---|
| 1.x | ^8.22.1; ^9.3.0 |
Install
composer require meysam-znd/laravel_health_check
Publish Config
php artisan vendor:publish --provider="Laravel\Health\Providers\HealthServiceProvider"
Usage
Edit the config file config/health-checker.php see the comments there for more information
Available checkers
databaseTests database connections.cacheTests for caching datadirectory-permissionTests permission in directoriesqueueTests for queue
How to add a new checker
You only need to extend \Laravel\Health\Checkers\BaseChecker and add to services in config/health-checker.php.
Routes and Responses
To access the health status you can use the follow routes:
health/statusLoad and list all check services.health/{service_name}/statusLoad only the chosen service and show his status.
The response for both cases will be like that:
{
status => false
health_status: [
{
cache: {
status: true,
message: null
}
},
{
database: {
status: true,
message: null
}
},
{
directory-permission: {
status: false,
message: "The directory /application/public/../storage/ is not writable."
}
},
{
queue: {
status: true,
message: null
}
}
]
}
Command usage
You can use the follow commands to check healthy in your cli application:
php artisan application-health:check-health
Or
php artisan application:health-check
Note: this package was made a fork from https://github.com/arquivei/laravel-health-checker