svidskiy/laravel-modulith
最新稳定版本:v0.0.1
Composer 安装命令:
composer require svidskiy/laravel-modulith
包简介
Vertical Slice Architecture for Laravel – group your code by business feature, scale to hundreds of models without losing your mind.
README 文档
README
Vertical Slice Architecture for Laravel — group your code by business feature, scale to hundreds of models without losing your mind.
Status: v0.1 — early access. Public API may change before v1.0.
Requirements
- PHP 8.3+
- Laravel 12+
Installation
composer require svidskiy/laravel-modulith php artisan modulith:install
Create a module
php artisan module:make Billing
Scaffolds modules/Billing/:
modules/Billing/
├── Http/Controllers/
├── Models/
├── database/migrations/
└── routes/
Anything you drop inside is auto-loaded — no manual provider registration.
Commands
| Command | Purpose |
|---|---|
module:make {name} |
Scaffold a new module |
module:list |
Show registered modules |
module:cache |
Cache the module manifest |
module:clear |
Drop the cache |
modulith:install |
Publish the config |
Configuration
config/modulith.php after modulith:install:
return [ 'path' => 'modules', // base_path(...) prefix or absolute 'namespace' => 'Modules', // PSR-4 root for module classes 'cache' => ['enabled' => env('MODULITH_CACHE', true)], 'auto_discover' => [ 'config' => true, 'routes' => true, 'views' => true, 'translations' => true, 'migrations' => true, 'commands' => true, 'blade_components' => true, 'policies' => true, 'events' => true, 'observers' => true, 'middleware' => true, ], ];
What gets auto-loaded per module
| Path inside module | Loader |
|---|---|
routes/web.php, routes/api.php |
RouteLoader |
database/migrations/*.php |
MigrationLoader |
config/*.php |
ConfigLoader |
resources/views/ |
ViewLoader (namespaced as <module>::) |
lang/ |
TranslationLoader |
View/Components/ |
BladeComponentLoader |
Console/*.php |
CommandLoader |
Listeners/*.php |
EventLoader |
Observers/*Observer.php |
ObserverLoader (auto-binds to matching Models/*) |
Policies/*Policy.php |
PolicyLoader (auto-binds to matching Models/*) |
middleware.php |
MiddlewareLoader |
License
MIT
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-06