tdebatty/laravel-resource-generator
Composer 安装命令:
composer require tdebatty/laravel-resource-generator
包简介
Source code generator for laravel resources
README 文档
README
A source code generator for Laravel resources.
In Laravel, you can create a resource controller using the command php artisan make:controller PostController --resource. But:
- the controller contains only empty methods
- you have to manually add request validation
- you have to write all your views
With this plugin, you immediately get working code:
- a fully functional controller with request validation
- basic views to list, create, modify and delete your resource
Installation
$ composer require --dev tdebatty/laravel-resource-generator
Example
$ php artisan resource:make Post -i fa
Generate migration and model...
Generate routes...
Generate views...
Generate controller...
Done!
You may now fill the migration file
And then run php artisan migrate
Your resources will be available at http://127.0.0.1:8000/app/posts
The default controller and views assume resources have a name field. You have to add this field manually to your migration file (and other fields according to your needs):
$ nano database/migrations/*_create_posts_table.php
You can now migrate and check the result:
$ php artisan migrate
$ php artisan serve
Compatibility
Currently generates code for Laravel 5.6 (Bootstrap 4). The generated code is vanilla Laravel code (i.e. views use Blade syntax with no additional libraries or dependencies).
The generator can also add icons using following icon sets:
- Font Awesome 5 :
php artisan resource:make Model -i fa - Font Awesome 4 :
php artisan resource:make Model -i fa4
tdebatty/laravel-resource-generator 适用场景与选型建议
tdebatty/laravel-resource-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.58k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2018 年 07 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tdebatty/laravel-resource-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tdebatty/laravel-resource-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 8
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-07-16


