fixik/ddd-generator
最新稳定版本:v0.0.3
Composer 安装命令:
composer require fixik/ddd-generator
包简介
DDD generator for Laravel
README 文档
README
A Laravel package for generating Domain-Driven Design (DDD) modules with CQRS, modular architecture, and HTTP API presets.
Opinionated, test-driven, production-ready scaffolding for large Laravel apps.
✨ Features
- Modular DDD structure (
App/Modules/*) - Clean separation:
- Domain / Application / Infrastructure
- CQRS (Commands / Queries / Handlers)
- HTTP API generation (Controllers, Requests, Resources, Routes)
- Idempotent generators (safe to re-run)
- Preset-based generation (
domain,cqrs,http-cqrs,http) - Custom base namespace and path
- Fully covered by tests
🚀 Quick Start
Install
composer require fixik/ddd-generator --dev
Generate API HTTP module
php artisan ddd:make http-cqrs Order --entity=Order
This will generate:
- Domain entity & repository
- CQRS commands / queries & handlers
- HTTP controller, request, resource
- Module routes
- Module ServiceProvider
📦 Presets
| Preset | Description |
|---|---|
domain |
Domain only (Entities, Events, Repositories) |
cqrs |
Domain + CQRS (Commands, Queries, Handlers) |
http |
Domain + HTTP (Controllers, Requests, Routes) |
http-cqrs |
Domain + CQRS + HTTP |
📚 Documentation
👉 Full documentation:
https://olegmarko.github.io/ddd-generator/
Includes:
- Architecture overview
- Presets explained
- CQRS flow
- Configuration
- Extending generators
🧠 Philosophy
This package enforces explicit architecture:
- No hidden magic
- No guessing entities
- No global routes
- No infrastructure leaks into domain
- Designed for long-living Laravel applications.
⚡ Performance & Caching
The generator provides optional cache commands for large, modular applications:
php artisan ddd:modules-cachephp artisan ddd:event-listeners-cachephp artisan ddd:cache-clear
These commands are intended ONLY for production environments.
They should NOT be used in:
- local development
- automated tests
- CI pipelines
They work similarly to Laravel's route:cache and event:cache
and significantly reduce bootstrapping overhead in large projects.
📄 License
MIT
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04