laravelha/generator
Composer 安装命令:
composer require laravelha/generator
包简介
Laravelha Generator
关键字:
README 文档
README
Laravel RAD Package based on Laravel-5-Generators-Extended
Install
After install fresh Laravel application:
- Install preset
composer require laravelha/preset-api --devorcomposer require laravelha/preset-web --dev - Run preset
php artisan preset ha-apiorphp artisan preset ha-web --option=auth - Via
composer require laravelha/generator --dev - Run
php artisan ha-generator:<COMMAND> <ARGUMENTS> <OPTIONS>to create automatically generated code. - The following commands are available.:
ha-generator:migration "Create a new migration class and apply schema at the same time" ha-generator:model "Create a new model class and apply schema at the same time" ha-generator:factory "Create a new factory class and apply schema at the same time" ha-generator:requests "Create a new requests class and apply schema at the same time" ha-generator:controller "Create a new controller and resources for api" ha-generator:resources "Create a new resources class and apply schema at the same time" ha-generator:route "Insert new resources routes" ha-generator:test "Create a new feature test and apply schema at the same time" ha-generator:lang "Create a new lang resource and apply schema at the same time" ha-generator:view "Create a new views resource and apply schema at the same time" ha-generator:breadcrumb "Insert new resources breadcrumb" ha-generator:nav "Insert new nav item" ha-generator:crud "Run all commands" ha-generator:existing:crud "Run all commands from a existing database" ha-generator:package "Create scaffolding structure to packages"
- For more information for each command use:
php artisan help ha-generator:<COMMAND>
Happy way
This is my approach to use it.
- Install laravel fresh application
composer create-project --prefer-dist laravel/laravel blog && cd blog
- Make the first commit
git init git add . git commit -m 'feat: install laravel fresh app'
- Install Laravelha/Preset for your case
composer require laravelha/preset-web --dev
- Run preset
php artisan preset ha-web --option=auth
- Make the commit
git add . git commit -m 'feat: install and run laravel laravelha/preset-web with auth'
- Install generator and publish config
composer require laravelha/generator --dev php artisan vendor:publish --tag=ha-generator
- Run crud generator
php artisan ha-generator:crud Category -s 'title:string(150), description:text:nullable, published_at:timestamp:nullable'
- Commit then
git add . git commit -m 'feat: create category crud by generator'
- Run other crud generator
php artisan ha-generator:crud Post -s 'title:string(150), content:text, published_at:timestamp:nullable, category_id:unsignedBigInteger:foreign'
- Commit last crud
git add . git commit -m 'feat: create post crud by generator'
It is very important that the stage is clean before running the generator, because if you give up what was generated it is possible to undo completely with
git clean -fd; git checkout .
Every command generated is store on /storage/logs, if you need detailer each command within crud, use the option
--log-details
Auto generated structure
app/
├── <SINGULAR_CLASS_NAME>.php
│
└── Http
├── Controllers
| ├── Auth
| ├── IndexController.php
| └── <SINGULAR_CLASS_NAME>Controller.php
|
└── Requests
└── Requests
├── <SINGULAR_CLASS_NAME>StoreRequest.php
└── <SINGULAR_CLASS_NAME>UpdateRequest.php
config/
└── ha-generator.php
database
├── factories
| └── <SINGULAR_CLASS_NAME>Factory.php
|
└── migrations
└── YYYY_MM_DD_HHmmSS_create_<PLURAL_CLASS_NAME>_table.php
resources
├── lang/pt-br
| └── <PLURAL_CLASS_NAME>.php
|
└── views
└── <PLURAL_CLASS_NAME>
├── create.blade
├── delete.blade
├── edit.blade
├── index.blade
└── show.blade
routes
├── api.php
├── breadcrumbs.php
└── web.php
Examples
API api generated from generator
WEB web application generated from generator
Screenshots
laravelha/generator 适用场景与选型建议
laravelha/generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.08k 次下载、GitHub Stars 达 22, 最近一次更新时间为 2020 年 01 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「generator」 「rad」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 laravelha/generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 laravelha/generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 laravelha/generator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
Module management package for Laravel
Alfabank REST API integration
Phalcon Model Generator
Auto-generate dummy data with realistic relationships per Model-like config classes
Php class generator
统计信息
- 总下载量: 5.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 22
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-05

