govindtomar/crud-generator-api

Laravel crud 生成器 api

1.0.2 2023-12-03 12:00 UTC

This package is auto-updated.

Last update: 2024-09-03 13:28:43 UTC


README

安装

composer require govindtomar/crud-generator-api
php artisan vendor:publish --provider="GovindTomar\CrudGeneratorApi\CrudGeneratorApiServiceProvider"

配置

您可以在 config/crud.php 找到配置文件

'code_type' => 'API',

示例

CRUD 创建

php artisan make:crud ContactMe --fields=text*name,email*email,text*subject,textarea*message

带有关系的 CRUD

php artisan make:crud ContactMe --fields=text*name,email*email,text*subject,textarea*message --model=User

带有迁移的 CRUD

php artisan make:crud ContactMe --fields=text*name,email*email,text*subject,textarea*message --migration=yes

带有关系和迁移的 CRUD

php artisan make:crud Post --fields="text*name,image*profile,image*cover,select*user",toggle*status,toggle*publish --model=User --migration=yes

可用字段

text | email | file | hidden | image | number | password | date | radio | select | textarea | toggle