lanciweb/laravel-make-crud
Composer 安装命令:
composer require lanciweb/laravel-make-crud
包简介
A Laravel Package that allows creation of Model, Migration, Seeder, Views, Routes and resource controller for CRUD operations.
README 文档
README
Laravel MakeCrud is a Laravel Package that helps you create all the files you need for CRUD operations on your models.
Installation
Use composer to install Laravel MakeCrud
composer require lanciweb/laravel-make-crud
Usage
Default command
This command has no options and represent the default behaviour:
php artisan make:crud Post # - Generates the model (Post.php) # - Generates a resource controller (PostController.php) # - Automatically imports the Post model in the controller # - Generates a seeder (PostSeeder.php) # - Generates a create table migration (create_posts_table***.php) # - Registers all the Resource routes in web.php for the posts # - Creates a view folder (resources/views/posts) # - The following blade files will be created in the folder # ----- index.blade.php # ----- show.blade.php # ----- create.blade.php # ----- edit.blade.php
Prefix
Adding a prefix to the model (i.e: Admin/Post) name will result in the following differences:
php artisan make:crud Admin\Post # - The controller will be placed in the 'Admin' folder # - Routes URIs will be prefixed with 'admin/' # - Routes names will be prefixed with 'admin.' # - Views will be placed in 'resources/views/admin/posts'
Api option
Adding the --api option will result in the following differences:
php artisan make:crud Post --api # - The controller will be placed in the 'Api' folder # - The controller will not have the 'create' and 'edit' methods # - Routes will be registered in the 'api.php' file # - Views will not be generated
Picking options
Adding any of the following options (except for --api) prevents the default behaviour and let you pick manually what you want to generate.
| option | alias | result |
|---|---|---|
--controller |
-c |
Generates the Resource Controller |
--migration |
-m |
Generates the create table Migration |
--seeder |
-s |
Generates the Seeder |
--factory |
-f |
Generates the Factory |
--policy |
-p |
Generates the Policy |
--requests |
-R |
Generates the Form Request |
--views |
-b |
Generates the Blade views |
--api |
See the Api option section | |
--all |
-a |
Adds all options available (except for the --api) |
Please note that a model will always be generated
Please not that the
--alloption can be used together with the--apioption.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
lanciweb/laravel-make-crud 适用场景与选型建议
lanciweb/laravel-make-crud 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.46k 次下载、GitHub Stars 达 33, 最近一次更新时间为 2023 年 03 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 lanciweb/laravel-make-crud 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lanciweb/laravel-make-crud 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 34
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-09