eoads/module-make
Composer 安装命令:
composer require eoads/module-make
包简介
Artisan command to scaffold Laravel modules with standard folder structure
README 文档
README
Artisan command to scaffold Laravel modules following the EO-ADS standard structure — backend + frontend together.
Requirements
- PHP ^8.2
- Laravel 11 or 12
Installation
composer require eoads/module-make
If you are starting a new project, install
eoads/eoads-starter-kitinstead — it includes this package and sets up the full project scaffold.
Usage
Backend + frontend (default)
php artisan module:make PurchaseOrder
Backend only
php artisan module:make PurchaseOrder --no-frontend
Overwrite an existing module
php artisan module:make PurchaseOrder --force
Generated structure
Assumes the following project layout:
my-project/
├── backend/ ← run artisan from here
└── frontend/
Backend — backend/Modules/PurchaseOrder/
Modules/PurchaseOrder/
├── app/
│ ├── Actions/
│ ├── DTOs/
│ ├── Enums/
│ ├── Events/
│ ├── Http/
│ │ ├── Controllers/
│ │ ├── Requests/
│ │ └── Resources/
│ ├── Models/
│ ├── Notifications/
│ ├── Observers/
│ ├── Policies/
│ ├── Repositories/
│ │ ├── PurchaseOrderRepositoryInterface.php
│ │ └── EloquentPurchaseOrderRepository.php
│ ├── Services/
│ └── Support/
├── Providers/
│ └── PurchaseOrderServiceProvider.php
├── routes/
│ ├── api.php
│ └── web.php
├── tests/
│ ├── Feature/
│ └── Unit/
└── module.json
Frontend — frontend/resources/js/modules/purchaseOrder/
purchaseOrder/
├── services/
│ └── purchaseOrderService.js ← all axios calls
├── stores/
│ └── purchaseOrderStore.js ← Pinia store
├── views/
│ └── PurchaseOrderView.vue ← page component
├── components/ ← local components
└── routes.js ← vue-router definitions
Auto-registered
After scaffolding the command automatically:
- Adds
Modules\PurchaseOrder\→Modules/PurchaseOrder/app/tocomposer.jsonPSR-4 - Enables the module in
modules_statuses.json
Then run:
composer dump-autoload
Architecture conventions
| Layer | Rule |
|---|---|
| Controller | Thin — orchestrate only, no business logic |
| FormRequest | All validation here — never $request->validate() inline |
| Action | Single-purpose business logic |
| Service | Stateful / multi-step business logic |
| Repository | All data access — bound via interface in ServiceProvider |
| Migration | Always in backend/database/migrations/ — never inside Modules/ |
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-18