定制 mqondisi/laravel-module-generator 二次开发

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

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

mqondisi/laravel-module-generator

最新稳定版本:v1.0.0-beta

Composer 安装命令:

composer require mqondisi/laravel-module-generator

包简介

Opinionated Laravel 9–13 module scaffolding (model, migration, repository, DTO, optional DAO, controllers)

README 文档

README

Opinionated scaffolding for Laravel: model, migration, repository (+ interface), Spatie-style DTO stub, optional DAO layer, and HTTP controllers. Skips existing files unless you pass --force.

Published on Packagist: mqondisi/laravel-module-generator

Requirements

  • PHP ^8.1
  • Laravel 9.x through 13.x (via illuminate/* ^9^13)

Installation

composer require mqondisi/laravel-module-generator

The service provider is auto-discovered; you do not need to register it manually in most apps.

For bleeding-edge changes from GitHub:

composer require mqondisi/laravel-module-generator:dev-master

Optional: Spatie Laravel Data

Generated DTOs under app/Data extend Spatie\LaravelData\Data. The package suggests installing Spatie in your application (it is not a hard dependency of this package, to avoid unnecessary transitive conflicts):

composer require spatie/laravel-data:^4

Usage

php artisan make:module Customer --api
php artisan make:module Customer --inertia
php artisan make:module Customer --tenant
php artisan make:module Customer --with-dao
php artisan make:module Customer --api --tenant --with-dao

Flags can be combined. With both --api and --inertia, an API controller and a web Inertia controller are generated (plus a page stub when Inertia is used).

Option Effect
--api JSON API controller under app/Http/Controllers/Api
--inertia Web controller + page stub under resources/js/Pages/.../ (Index.vue, Index.jsx, or Index.svelte)
--inertia-stack With --inertia: vue (default), react, or svelte — picks stub file and extension
--tenant team_id on migration, model global scope / scopeTeam, tenant docblocks
--with-dao app/DAO + app/DAO/Interfaces; repository depends on the DAO only
--force Overwrite files that already exist (use with care)

Examples:

php artisan make:module Customer --inertia --inertia-stack=react
php artisan make:module Customer --inertia --inertia-stack=svelte

After a run, the command prints Created, Skipped, and Overwritten lines plus a short summary.

Repository bindings

The generator creates or updates app/Providers/RepositoryServiceProvider.php and may append your provider to config/app.php when that file uses the usual AppServiceProvider::class marker (Laravel 9–10 style). On Laravel 11+, register App\Providers\RepositoryServiceProvider::class in bootstrap/providers.php if it is not picked up automatically.

License

MIT

统计信息

  • 总下载量: 130
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固