定制 eoads/module-make 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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-kit instead — 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/ to composer.json PSR-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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-18