happenv-com/laravel-true-modular-health 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Health for Laravel True Modular

Latest Version on Packagist Total Downloads

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
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固