toniel/laravel-ddd
Composer 安装命令:
composer require toniel/laravel-ddd
包简介
Domain-Driven Design (DDD) scaffolding for Laravel with support for Laravel Actions and Spatie Data
README 文档
README
A powerful Domain-Driven Design (DDD) scaffolding package for Laravel with support for Laravel Actions and Spatie Data.
Note: This package is currently in early development (v0.x). The API may change before the stable 1.0 release. Feedback and contributions are welcome!
Features
- ✅ 15 comprehensive commands for complete DDD workflow
- ✅ Auto-generate domain structure with a single command
- ✅ Auto-register ServiceProvider (Laravel 9-12)
- ✅ Auto-load routes, migrations, and views
- ✅ 3 controller types - Resource, API, Invokable
- ✅ Laravel Actions integration (as Job, Controller, or standalone)
- ✅ Spatie Laravel Data integration with validation
- ✅ Inertia.js page generation (Vue & React with TypeScript)
- ✅ Blade views with domain namespace
- ✅ API Resources (single & collection)
- ✅ Form Requests with validation
- ✅ Jobs (queued & synchronous)
- ✅ Mail classes with markdown support
- ✅ Separate folders for Blade (Views) and Inertia (Pages)
- ✅ PSR-4 autoloading
- ✅ Fully tested with PHPUnit
Requirements
- PHP ^8.1
- Laravel ^9.0 | ^10.0 | ^11.0 | ^12.0
Installation
composer require toniel/laravel-ddd php artisan ddd:install composer dump-autoload
Quick Start
# Create a complete domain
php artisan ddd:domain Product
php artisan ddd:model Product Product -mfs
php artisan ddd:controller Product ProductController --api
php artisan ddd:page Product ProductIndex
php artisan migrate
Documentation
For complete documentation, please visit GitHub Repository.
Available Commands
| Command | Description |
|---|---|
ddd:install |
Setup DDD structure |
ddd:domain {name} |
Create new domain |
ddd:controller {domain} {name} |
Create controller (Resource/API/Invokable) |
ddd:model {domain} {name} |
Create model with optional migration/factory/seeder |
ddd:migration {domain} {name} |
Create migration |
ddd:factory {domain} {name} |
Create factory |
ddd:seeder {domain} {name} |
Create seeder |
ddd:action {domain} {name} |
Create Laravel Action |
ddd:data {domain} {name} |
Create Spatie Data object |
ddd:view {domain} {name} |
Create Blade view |
ddd:page {domain} {name} |
Create Inertia page (Vue/React) |
ddd:resource {domain} {name} |
Create API resource |
ddd:request {domain} {name} |
Create form request |
ddd:job {domain} {name} |
Create job |
ddd:mail {domain} {name} |
Create mail class |
Testing
composer test
Roadmap to 1.0
- Community feedback and bug fixes
- Additional generators (Events, Listeners, Policies, etc.)
- More comprehensive test coverage
- Documentation improvements
- Real-world usage validation
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Security
If you discover any security related issues, please email l.toni2007@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
toniel/laravel-ddd 适用场景与选型建议
toniel/laravel-ddd 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 119 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「generator」 「laravel」 「ddd」 「scaffolding」 「domain-driven-design」 「laravel-actions」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 toniel/laravel-ddd 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 toniel/laravel-ddd 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 toniel/laravel-ddd 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
Runn Me! Value Objects Library
Build a domain-oriented application on Laravel Framework
Symfony bundle for broadway/broadway.
Provides Symfony param converters for mediagone/types-common package.
DDD auth basic class
统计信息
- 总下载量: 119
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-12