Laravel Health
Laravel Health stats
- Downloads
- 1.7M
- Stars
- 607
- Open Issues
- 0
- Forks
- 120
Monitor the health of a Laravel application
Laravel Health by Spatie
The spatie/laravel-health package is a robust tool designed to monitor and report on the health of your Laravel application. It allows you to register various checks that assess the condition of different aspects of your app, such as disk space usage.
Key Features
- Customizable Checks: Implement checks like
UsedDiskSpaceCheckto monitor and react to specific conditions such as disk space thresholds. - Notifications: Configure alerts to be sent via email or Slack when certain parameters are met, such as warning and failure thresholds for disk usage.
- Documentation: Comprehensive documentation is available, detailing how to implement and use the various features of the package.
Installation and Usage
Install the package via composer:
composer require spatie/laravel-health
Implement health checks within your application, for example:
use Spatie\Health\Facades\Health;use Spatie\Health\Checks\Checks\UsedDiskSpaceCheck; Health::checks([ UsedDiskSpaceCheck::new() ->warnWhenUsedSpaceIsAbovePercentage(70) ->failWhenUsedSpaceIsAbovePercentage(90),]);
This configuration will send notifications based on the thresholds set for disk usage.
Additional Resources and Community Contributions
- Support and Sponsorship: You can support the continued development of this and other Spatie packages by considering their paid products or sending a postcard.
- Alternatives: Explore alternative packages if this one doesn't meet your needs.
- Contributing: Contributions to the package are welcome, and the contribution guidelines are detailed in the repository.
Testing and Security
Run tests using:
composer test
For security vulnerability reports, review the package's security policy.
This package is an excellent choice for Laravel developers looking to implement health checks and monitoring within their applications, ensuring operational reliability and performance insights. Find more information and detailed documentation on the official documentation site.