bfg / wood
Laravel 高级框架控制器,用于代码生成,快速轻松地更改框架。使用最佳代码生成器自动化所有相同任务。
1.3.0
2023-12-24 18:07 UTC
Requires
- php: ^8.0
- bfg/attributes: ^1.2
- bfg/comcode: ^1.1.0
- elementaryframework/fire-fs: ^1.2
- laravel/framework: ^8.0|^9.0|^10.0
- workerman/workerman: ^4.1
This package is auto-updated.
Last update: 2024-09-24 19:44:23 UTC
README
安装
composer require bfg/wood
描述
Laravel 高级框架控制器,用于代码生成,快速轻松地更改框架。使用最佳代码生成器自动化所有相同任务。
JSON 模式演示
快速开始
为了以 JSON 格式开始生成,运行 php artisan wood:install
命令以创建生成器数据库,然后使用 php artisan wood:import
命令创建一个 JSON 文件。之后,在你的 database
文件夹中会出现一个 wood.json
文件。在其中,你根据方案描述你的文件。一旦方案完成,我们调用 php artisan wood:build
命令来收集所有更改。每次更改方案时,jason 都会运行 php artisan wood:build
命令。
命令
php artisan wood:install
- 设置生成器的初始数据库php artisan wood:run
- 开始生成过程php artisan wood:build
- 从JSON
文件构建数据php artisan wood:import
- 从表中导入所有数据并创建JSON
文件php artisan wood:sync
- 将现有模型的主数据同步到表中
JSON 结构
<value>
- 默认数据
{ "models": [ { "class": "string", "foreign": "string<id>", "increment": "bool<true>", "auth": "bool<false>", "created": "bool<true>", "updated": "bool<true>", "deleted": "bool<true>", "migration": "bool<true>", "fields": [ { "name": "string", "cast": "string<string>", "type": "string<string>", "type_parameters": "array<[]>", "has_default": "bool<false>", "default": "string<null>", "hidden": "bool<false>", "nullable": "bool<false>", "unique": "bool<false>", "index": "bool<false>", "comment": "string<null>", "type_details": "array<[]>" } ], "relations": [ { "related_model": "class", "name": "string<null>", "type": "string<hasOne>", "reverse_name": "string<null>", "reverse_type": "string<hasMany>", "able": "string<null>", "with": "bool<false>", "with_count": "bool<false>", "nullable": "bool<false>", "cascade_on_update": "bool<true>", "cascade_on_delete": "bool<true>", "null_on_delete": "bool<false>" } ], "observers": [ { "class": "string", "events": "array" } ], "traits": [ { "class": "string" } ], "implements": [ { "class": "string" } ] } ], "events": [ { "class": "string", "listeners": [ { "row": "string" } ] } ], "controllers": [ { "class": "string", "methods": [ { "row": "string", "event": "class" } ] } ], "factories": [ { "model": "class", "lines": [ { "field": "string", "php": "string<null>" } ] } ], "seeds": [ { "class": "string", "model": "class", "factory": "bool<false>", "count": "int<1>", "rows": [ { "row": "array" } ] } ], "requests": [ { "class": "string", "access": "string<'true'>", "rules": [ { "name": "string", "rules": "array" } ] } ], "resources": [ { "class": "string" } ] }
应用程序文档
我们提供了丰富的 文档,您可以在其中了解 bfg wood。