sterxa/laravel-ddd-helper
Composer 安装命令:
composer require sterxa/laravel-ddd-helper
包简介
Useful Artisan commands to help Laravel apps that utilizes Domain Driven Design.
README 文档
README
The project was originally forked from https://github.com/signifly/laravel-domain-commands
The sterxa/laravel-ddd-helper package adds a handful of useful Artisan commands to your Laravel application. It assumes you are utilizing the Domain Driven Design approach.
It is heavily inspired by the DDD approach mentioned in this great article by Brent from Spatie.
In addition, it assumes that you have a separate namespace for your domain. Take a look of this example of the autoload section from a composer.json file:
{
...
"autoload": {
"psr-4": {
"App\\" : "app/App/",
"Domain\\" : "app/Domain/",
"Support\\" : "app/Support/"
},
...
}
}
Basic Usage
The package comes with a handful of commands out of the box.
Actions
Generate a new Action using the domain:action command:
php artisan domain:action CreateUserAction -d User
NOTE: You may use the -d|--domain option to specify the given domain for the action. If you do not specify a domain, it will be generated within the default namespace. You may configure that in the config file.
Data Transfer Objects
Generate a new Data Transfer Object class using the domain:dto command:
php artisan domain:dto UserData -d User
Enums
Generate a new Enum class using the domain:enum command:
php artisan domain:enum UserType -d User
Events
Generate a new Event class using the domain:event command:
php artisan domain:event UserCreated -d User
Models
Generate a new Eloquent model class using the domain:model command:
php artisan domain:model User -d User
Observers
Generate a new Observer class using the domain:observer command:
php artisan domain:observer UserObserver -d User
Policies
Generate a new Policy class using the domain:policy command:
php artisan domain:policy UserPolicy -d User
Rules
Generate a new Rule class usign the domain:rule command:
php artian domain:rule CustomEmailRule -d User
Installation
You can install the package via composer:
composer require sterxa/laravel-ddd-helper
The package will automatically register itself.
You can optionally publish the config file with:
php artisan vendor:publish --tag="ddd-helper-config"
Testing
composer test
Security
If you discover any security issues, please email office@sterxa.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
sterxa/laravel-ddd-helper 适用场景与选型建议
sterxa/laravel-ddd-helper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 09 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 sterxa/laravel-ddd-helper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sterxa/laravel-ddd-helper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-24