io-digital / health-check
A Laravel package that performs health checks on your application
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
- linfo/linfo: ^3.0
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0||~6.0
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2021-05-01 10:15:01 UTC
README
HealthCheck provides your Laravel application with a /healthcheck
endpoint to make it easier nice and easy to view the status of your application.
Install
supports package auto discovery for Laravel
Via Composer
$ composer require io-digital/health-check
Add the ServiceProvider to your config/app.php providers array:
IoDigital\HealthCheck\HealthCheckServiceProvider::class,
Then run the following command artisan command:
$ php artisan vendor:publish --provider="IoDigital\HealthCheck\HealthCheckServiceProvider"
This will publish the package config file to config/healthcheck.php
.
You currently have the options to select which tests to perform:
'ssl' => true, 'database' => true, 'application' => true, //System information 'memory' => false, 'cpu_usage' => false,
Usage
The package automatically adds the /healthcheck
endpoint to your application. All you need to do is hit that route.
For now the endpoint returns the following:
200
reponse- JSON object with the following layout:
{ "application": { "message": "Application is running", "success": true }, "database": { "message": "There was an error connecting to the database. Error has been logged.", "success": false }, "ssl": { "message": "SSL is working.", "success": true } }
Future releases will hope to expand on what is tested.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email :author_email instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.