#CURD Commands
The EasyAdmin8 framework includes built-in commands for quickly generating CURD, including controllers, views, models, and JS files. This further improves developer efficiency.
#Common Commands
# Generate CURD for the ea8_test_goods table
php think curd -t test_goods
# Generate CURD for ea8_test_goods, force overwrite on file conflict
php think curd -t test_goods -f 1
# Delete CURD for ea8_test_goods
php think curd -t test_goods -d 1
# Generate CURD for ea8_test_goods, controller at demo/Goods.php
php think curd -t test_goods -c demo/Goods
# Generate CURD for ea8_test_goods, model at demo/Goods.php
php think curd -t test_goods -m demo/Goods
# Generate CURD for ea8_test_goods, related to ea8_test_cate table, with foreign key cate_id
php think curd -t test_goods -r test_cate --foreignKey=cate_id --primaryKey=id
# Generate CURD for ea8_test_goods, related to ea8_test_cate table, only show title and image fields
php think curd -t test_goods -r test_cate --foreignKey=cate_id --relationOnlyFields=title,image
# Generate CURD for ea8_test_goods, related to ea8_test_cate table, set the main table foreign key cate_id dropdown to show the related table's title field
php think curd -t test_goods -r test_cate --foreignKey=cate_id --relationBindSelect=title
# Generate CURD for ea8_test_goods, set logo field suffix as single image
php think curd -t test_goods --imageFieldSuffix=logo
# Generate CURD for ea8_test_goods, ignore remark and stock fields
php think curd -t test_goods --ignoreFields=remark --ignoreFields=stock#Parameter Reference
| Short | Long | Description |
|---|---|---|
| -t | --table=VALUE | Main table name |
| -c | --controllerFilename=VALUE | Controller filename |
| -m | --modelFilename=VALUE | Main table model filename |
| -f | --force=VALUE | Force overwrite mode |
| -d | --delete=VALUE | Delete mode |
| --checkboxFieldSuffix=VALUE | Checkbox field suffix | |
| --radioFieldSuffix=VALUE | Radio button field suffix | |
| --imageFieldSuffix=VALUE | Single image field suffix | |
| --imagesFieldSuffix=VALUE | Multiple images field suffix | |
| --fileFieldSuffix=VALUE | Single file field suffix | |
| --filesFieldSuffix=VALUE | Multiple files field suffix | |
| --dateFieldSuffix=VALUE | Date field suffix | |
| --switchFields=VALUE | Switch/toggle fields | |
| --selectFields=VALUE | Dropdown select fields | |
| --editorFields=VALUE | Rich text editor fields | |
| --sortFields=VALUE | Sort fields | |
| --ignoreFields=VALUE | Fields to ignore | |
| -r | --relationTable=VALUE | Related table name |
| --foreignKey=VALUE | Foreign key | |
| --primaryKey=VALUE | Primary key | |
| --relationOnlyFields=VALUE | Fields to display only from related model | |
| --relationBindSelect=VALUE | Related model field for main table foreign key dropdown | |
| --relationModelFilename=VALUE | Related model filename |
