kepex / laravel-crud-generator
php artisan 命令,通过数据库表生成完全工作的 CRUD,仅服务器端分页
v0.1.8
2019-01-03 18:48 UTC
Requires
- php: >=5.5.9
- laravel/framework: >=5.0.0
This package is not auto-updated.
Last update: 2024-09-29 22:50:30 UTC
README
php artisan 命令,通过数据库表生成完全工作的 CRUD,仅服务器端分页
安装
php composer.phar require kepex/laravel-crud-generator
将以下行添加到 config/app.php 文件的 'providers' 数组中
CrudGenerator\CrudGeneratorServiceProvider::class,
使用方法
使用所需的模型名称作为输入
学生表的 CRUD
php artisan make:crud student
或整个数据库
php artisan make:crud all
具有自定义布局的整个数据库
php artisan make:crud all --master-layout=layouts.master
因为有时您只需要视图和控制器的基本代码,您可以使用具有自定义控制器名称的现有模型
php artisan make:crud student --master-layout=master --custom-controller=dashboard
更多选项
php artisan help make:crud
自定义模板
此插件的最佳功能在于您可以创建自己的模板并按您喜欢的任何方式生成代码
运行此命令
php artisan vendor:publish
现在您将在 resources/templates/ 中找到需要修改的文件
如果您想回到默认状态,只需删除它们即可
如果您有任何问题或觉得这个库很有用,请在twitter @kEpEx上告诉我