happenv-com/laravel-true-modular-health
Composer 安装命令:
composer require happenv-com/laravel-true-modular-health
包简介
Module-scoped health checks for laravel-true-modular: declare checks per module, aggregate runtime + architecture health via Spatie Laravel Health and module:doctor.
README 文档
README
A companion to laravel-true-modular that lets each
module declare its own health checks, registers them into
Spatie Laravel Health, and adds a module:doctor command
that aggregates runtime health (the module checks) with architecture health (dependency-cycle
detection) in one report.
Why
The core package gives every module a persistent capability record (the module manifest). This package reads that manifest, so health checks live next to the module that owns them instead of in one central list:
$module ->hasRoutes() ->hasHealthChecks([ InventoryLedgerCheck::class, ReservationIntegrityCheck::class, ]);
InventoryLedgerCheck is a plain Spatie Check (Spatie\Health\Checks\Check). The core stores only the
class name; this package validates and instantiates it.
Install
composer require happenv-com/laravel-true-modular-health
It auto-discovers. On boot it merges every module's declared checks into Spatie Health (preserving any
checks you registered yourself), so your existing health:check command, scheduled run, and dashboard
include them automatically.
module:doctor
php artisan module:doctor # runtime + architecture php artisan module:doctor --module=inventory # runtime checks for one module (architecture still runs) php artisan module:doctor --json # machine-readable
The command exits non-zero when any check is failed or crashed, so it doubles as a CI gate. JSON
output carries a stable envelope:
{
"schema": { "name": "doctor", "version": 1 },
"summary": { "ok": 2, "warning": 0, "failed": 1, "crashed": 0, "skipped": 0 },
"modules": {
"inventory": [
{ "check": "InventoryLedger", "status": "failed", "message": "..." }
],
"architecture": [
{ "check": "Cycle", "status": "ok", "message": null }
]
}
}
Architecture checks
Cycle (Happenv\LaravelTrueModular\Health\Architecture\CycleCheck) fails when the module dependency
graph contains a circular dependency. It reuses the core's own topological sort, so it sees the same
edges the framework uses to order providers.
License
MIT.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-28