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.
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.
composer require happenv-com/laravel-true-modular-healthIt 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.
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-readableThe 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 }
]
}
}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.
The package ships a Laravel Boost skill, true-modular-health-development, in resources/boost/skills/. php artisan boost:install (or boost:update) offers it to your coding agent: how to write and declare a module's checks, run module:doctor as a gate, and the naming and boot-time pitfalls.
MIT.
