brightfish / health-checks
Laravel 的简单健康检查
0.8.1
2023-04-13 16:30 UTC
Requires
- php: ^8.0
- illuminate/config: ^9.0 || ^10.6
- illuminate/console: ^9.0 || ^10.6
- illuminate/contracts: ^9.0 || ^10.6
- illuminate/routing: ^9.0 || ^10.6
- illuminate/support: ^9.0 || ^10.6
- nesbot/carbon: ^2
Requires (Dev)
- brianium/paratest: ^6.2
- friendsofphp/php-cs-fixer: ^3.16
- nunomaduro/collision: ^6.2
- orchestra/testbench: ^7.24 || ^8.3
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.3
- vimeo/psalm: ^4.4
README
用法
从命令行运行所有已注册的检查
php artisan health:check
或向内置的 health
端点发送 HTTP 请求
curl GET https://your.app/health
安装
使用 composer 安装包
composer require brightfish/health-checks
发布配置文件
php artisan vendor:publish --provider="Brightfish\HealthChecks\HealthServiceProvider" --tag="health-checks-config"
创建自定义健康检查类
namespace App\Health\MyCustomCheck; class MyCustomCheck extends \Brightfish\HealthChecks\Checks\AbstractCheck { public function run(): bool { return false; } public function getMessage(): string { return 'Error'; } }
最后,在配置文件中列出该类
return [ 'checks' => [ \App\Health\MyCustomCheck::class, ], ];
测试
composer test
贡献
请参阅 CONTRIBUTING 获取详细信息。
安全漏洞
请审查 我们的安全策略 了解如何报告安全漏洞。
致谢
许可证
GNU 通用公共许可证 (GPL)。请参阅 许可证文件 获取更多信息。