| Releases | Laravel |
|---|---|
| 1.x | ^5.7 |
| 2.x | ^7.30.3; ^8.22.1 |
| 3.x | ^8.22.1; ^9.3.0 |
| 4.x | ^10.0; ^11.0 |
composer require arquivei/laravel-health-checkerEdit the config file config/health-checker.php see the comments there for more information
databaseTests database connections.cacheTests for caching datadirectory-permissionTests permission in directoriesqueueTests for queue
You only need to extent \Laravel\Health\Checkers\BaseChecker and add to services in config/health-checker.php.
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: {
code: 200,
message: "OK"
},
health_status: [
{
cache: {
is_healthful: true,
message: null
}
},
{
database: {
is_healthful: true,
message: null
}
},
{
directory-permission: {
is_healthful: false,
message: "The directory /application/public/../storage/ is not writable."
}
},
{
queue: {
is_healthful: true,
message: null
}
}
]
}
You can use the follow commands to check healthy in your cli application:
php artisan application-health:check-healthOr
php artisan application:health-checkWe provide docker images to help set up the development environment. So, in order to build the images, install the dependencies and run the tests, you may execute the command:
makeAfter the initial setup you can use the bin/php and bin/composer
scripts (wrappers for the docker images) to run the tests and install
new dependencies.