shomisha/crudly

Crudly 是一个命令行工具,使用简单的命令行向导生成所有 CRUD 机制。

安装: 92

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 1

开放问题: 0

类型:

1.0.0 2021-05-15 13:34 UTC

This package is auto-updated.

Last update: 2024-09-18 23:34:34 UTC


README

Latest Stable Version Software License

Crudly 是一个命令行工具,用于生成功能齐全的 CRUD 机制,支持使用单个基于控制台向导的 API 和基于 Web 的 CRUD。

你所要做的就是运行 php artisan crudly:model,通过向导,然后 voilà,你就可以设置了。

以下是运行方法

shomisha@shomisha crudly % php artisan crudly:model

 Enter the name of your model:
 > Post

Define model properties:

 Enter property name:
 > id

 Choose property type:
  [0 ] boolean
  [1 ] string
  [2 ] email
  [3 ] text
  [4 ] integer
  [5 ] big integer
  [6 ] tiny integer
  [7 ] float
  [8 ] date
  [9 ] datetime
  [10] timestamp
  [11] json
 > big integer

 Should this field be unsigned? (yes/no) [yes]:
 > 

 Should this field be auto-increment? (yes/no) [yes]:
 > 

 Should this field be unique? (yes/no) [no]:
 > 

 Should this field be nullable? (yes/no) [no]:
 > 

 Should this field be the primary key? (yes/no) [yes]:
 > 

 Should this field be a foreign key? (yes/no) [no]:
 > 

 Do you want to add a model property? (yes/no) [yes]:
 > 

 Enter property name:
 > title

 Choose property type:
  [0 ] boolean
  [1 ] string
  [2 ] email
  [3 ] text
  [4 ] integer
  [5 ] big integer
  [6 ] tiny integer
  [7 ] float
  [8 ] date
  [9 ] datetime
  [10] timestamp
  [11] json
 > string

 Should this field be unique? (yes/no) [no]:
 > 

 Should this field be nullable? (yes/no) [no]:
 > 

 Should this field be a foreign key? (yes/no) [no]:
 > 

 Do you want to add a model property? (yes/no) [yes]:
 > 

 Enter property name:
 > body

 Choose property type:
  [0 ] boolean
  [1 ] string
  [2 ] email
  [3 ] text
  [4 ] integer
  [5 ] big integer
  [6 ] tiny integer
  [7 ] float
  [8 ] date
  [9 ] datetime
  [10] timestamp
  [11] json
 > text

 Should this field be unique? (yes/no) [no]:
 > 

 Should this field be nullable? (yes/no) [no]:
 > 

 Should this field be a foreign key? (yes/no) [no]:
 > 

 Do you want to add a model property? (yes/no) [yes]:
 > 

 Enter property name:
 > published_at

 Choose property type:
  [0 ] boolean
  [1 ] string
  [2 ] email
  [3 ] text
  [4 ] integer
  [5 ] big integer
  [6 ] tiny integer
  [7 ] float
  [8 ] date
  [9 ] datetime
  [10] timestamp
  [11] json
 > datetime

 Should this field be unique? (yes/no) [no]:
 > 

 Should this field be nullable? (yes/no) [no]:
 > 

 Do you want to add a model property? (yes/no) [yes]:
 > no

 Do you want soft deletion for this model? (yes/no) [no]:
 > yes

 No 'deleted_at' column found. Please choose column for soft deletion:
  [0] published_at
  [1] Create new column
 > 1

 Enter column name:
 > archived_at

 Do you want timestamps for this model? (yes/no) [no]:
 > 

 Should this model have web pages for CRUD actions? (yes/no) [yes]:
 > 

 Should web CRUD actions be authorized? (yes/no) [yes]:
 > 

 Do you want web CRUD tests? (yes/no) [yes]:
 > 

 Should this model have API endpoints for CRUD actions? (yes/no) [yes]:
 > 

 Should API CRUD endpoints be authorized? (yes/no) [yes]:
 > 

 Do you want API CRUD tests? (yes/no) [yes]:
 > 

shomisha@shomisha crudly %

前往 Post 示例文件夹,查看此向导会生成什么 CRUD 结构。

请务必查看 Wiki 页面,在那里你可以了解 Crudly 的功能和限制,并学习如何使用它来加快你的开发过程。