backstage/laravel-ok
Composer 安装命令:
composer require backstage/laravel-ok
包简介
Is your Laravel app OK? Health checks running in production to ensure you can sleep well at night and be sure everything is still OK.
README 文档
README
Health checks made in production to ensure you can sleep well at night and be sure everything is still OK.
Installation
You can install the package via composer:
composer require backstage/laravel-ok
You can then install the package by using the ok:install Artisan command:
php artisan ok:install
This is the contents of the published config file:
return [ 'notifications' => [ 'enabled' => env('LARAVEL_OK_NOTIFICATIONS_ENABLED', true), 'failed_notification' => CheckFailedNotification::class, 'notifiable' => Notifiable::class, 'via' => [ // 'discord' => [ // 'channel' => 123456790, // ], // 'mail' => [ // 'to' => 'text@example.com', // ], // 'slack' => [ // 'webhook' => 'webhook-url', // ], // 'telegram' => [ // 'channel' => 1234567890, // ], ], ], 'checks' => [ 'audit' => [ 'path' => [ // '~/some/bin', ], ], ], ];
Usage
To register checks for your application, you need to register them in the checks array in your AppServiceProvider register method.
use Backstage\Laravel\OK\Facades\OK; class AppServiceProvider extends ServiceProvider { // ... public function register() { OK::checks([ EnvironmentCheck::shouldBe('production'), DebugModeCheck::shouldBe('false'), ]); } }
You can now run the checks using the ok:check Artisan command:
php artisan ok:check
Available checks
- Cache Check: Check whether reading and writing to the cache is possible.
- Composer Outdated Check: Checks whether there are outdated packages in your project and informs you of the findings.
- Composer Audit Check: Checks whether there are any security vulnerabilities in your composer dependencies.
- CPU Load Check: Checks whether the total CPU load is above a certain percentage on a short, mid and long term.
- Config Cache Check: Checks whether the config is cached.
- Database Check: Checks whether a connection can be established on the configured connection.
- Database Connection Count Check: Checks whether the database's connection count exceeds a configurable limit.
- Database Size Check: Checks whether the database's data exceeds a configurable size limit.
- Database Table Size Check: Does the same as the Database Size Check but for a specific table.
- Debug Mode Check: Checks whether debug mode is enabled.
- Directory Check: Checks whether the configured directories exist.
- Disk Space Check: Checks whether the disk space is below a certain threshold.
- DotEnv Check: Checks whether the configured environment variables are accessible in the application.
- Environment Check: Checks whether the current environment matches the configured environment type.
- Event Cache Check: Checks whether events are cached.
- Extension Check: Checks whether the configured PHP extensions are loaded.
- File Check: Does the same as the Directory Check but for files.
- Horizon Check: Checks whether Horizon is running.
- Memory Usage Check: Checks whether the total memory usage exceeds a configurable limit in the form of a percentage.
- NPM Audit Check: Checks whether there are any security vulnerabilities in your npm dependencies.
- NPM Installed Package Check: Checks whether a certain npm package is installed.
- OPCache Check: Checks whether OP cache and optionally the JIT compiler are configured and running.
- Permission Check: Checks whether the configured filesystem items have the correct permissions for the current user.
- Ping check: Checks whether the application can ping the specified address, if the address is not specified it defaults to
www.google.com. - Process Count Check: Checks whether the configured programs are exceeding the configured process count.
- Queue Check: Checks whether the queue is running.
- Reboot Check: Checks whether the server has rebooted recently.
- Redis Check: Checks whether the application can connect to the configured redis connections.
- Redis Memory Usage Check: Checks whether the Redis instance is exceeding a configured amount of memory usage.
- Route Cache Check: Checks whether routes are cached.
- Scheduler Check: Checks whether the scheduler has is still online and running jobs.
- Storage Check: Checks whether the configured disks can be written to and read from.
- UptimeCheck: Checks whether the server's uptime exceeds a configured maximum.
Inspired by
This package is inspired by Laravel Health.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
backstage/laravel-ok 适用场景与选型建议
backstage/laravel-ok 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.47k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2025 年 02 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「monitoring」 「health」 「laravel」 「vormkracht10」 「laravel-ok」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 backstage/laravel-ok 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 backstage/laravel-ok 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 backstage/laravel-ok 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Symfony bundle for chameleon-system/sanitycheck
Is your Laravel app OK? Health checks running in production to ensure you can sleep well at night and be sure everything is still OK.
Provides healthcheck endpoints in accordance with IETF's healthcheck draft RFC
Provide status and health api endpoints
SoftWax Health Check Bundle for Symfony framework
1Pilot client for Symfony
统计信息
- 总下载量: 2.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-26