happenv-com/laravel-true-modular
Composer 安装命令:
composer require happenv-com/laravel-true-modular
包简介
README 文档
README
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
- Topological provider ordering — module service providers are sorted by their
composer.jsondependencies, so a module always boots after the modules it depends on. - Enhanced lifecycle —
register() → initialize() → boot(). Theinitialize()phase runs after every module is registered but before any boots, the right window for morph maps, permissions, drivers, and Livewire/Filament hooks. - Architecture tooling —
module:graph,module:impact,module:why,module:list, with--format=jsonfor 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
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-29