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

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

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

happenv-com/laravel-true-modular

Composer 安装命令:

composer require happenv-com/laravel-true-modular

包简介

README 文档

README

Tests

Turn a Laravel application into a modular monolith. Modules are Composer packages that boot in topological dependency order, with an extra initialize() lifecycle phase between register() and boot() for cross-module coordination — plus architecture analysis commands for the module graph.

class CatalogServiceProvider extends ModuleProvider
{
    public function configureModule(Module $module): void
    {
        $module
            ->name('acme/catalog')
            ->hasConfig('catalog')
            ->hasRoutes('web', 'api')
            ->hasViews()
            ->hasMigrations()
            ->runsMigrations();
    }
}

Why

  1. Topological provider ordering — module service providers are sorted by their composer.json dependencies, so a module always boots after the modules it depends on.
  2. Enhanced lifecycleregister() → initialize() → boot(). The initialize() phase runs after every module is registered but before any boots, the right window for morph maps, permissions, drivers, and Livewire/Filament hooks.
  3. Architecture toolingmodule:graph, module:impact, module:why, module:list, with --format=json for CI gates.

Install

composer require happenv-com/laravel-true-modular

Then point bootstrap/app.php at the custom Application — see Getting started.

Requires PHP 8.3+ and Laravel 12/13.

Documentation

Full documentation lives in docs/:

Getting started Install and create your first module.
Module builders The fluent Module API and every feature.
Lifecycle hooks & schemas Overridable provider hooks; report JSON schema.
Config merging The four config strategies and merge semantics.
Model extensions Add attributes/relations to another module's model.
Architecture & runtime The lifecycle and the analysis layer.
Module dependencies Discovery, ordering, cycles.
CLI commands Graph / impact / why / list.
Best practices · Anti-patterns Do's and don'ts.
Extending the package Add features, renderers, sources.
Testing Fixtures, helpers, patterns.
Laravel Boost AI guidelines & skills for coding agents.

Development

composer install
vendor/bin/pest             # tests (Pest 4)
vendor/bin/pint             # format
vendor/bin/phpstan analyse  # static analysis (level 6 + larastan)

License

See composer.json for license information.

统计信息

  • 总下载量: 1.19k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-29