meysam-znd / laravel_health_check
By using this package you can monitor the health of your application
1.1.1
2022-11-13 09:53 UTC
Requires
- php: ^7.4 || ^8.0
- laravel/framework: ^8.22.1 || ^9.3.0
Requires (Dev)
- mockery/mockery: ^1.3.3
- orchestra/testbench: ^6.24.1 || ^7.1.0
- predis/predis: ^1.0
Suggests
- guzzlehttp/guzzle: ~6.0
- predis/predis: ^1.0
This package is auto-updated.
Last update: 2025-03-13 14:50:56 UTC
README
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
database
Tests database connections.cache
Tests for caching datadirectory-permission
Tests permission in directoriesqueue
Tests 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/status
Load and list all check services.health/{service_name}/status
Load 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