composer require bfg/wood
Laravel's advanced framework controller for a code generation, change your framework quickly and easily. Automate all the same tasks with best code generator.
In order to start generating in json format, run the php artisan wood:install
command in order to create the generator database, then create a json file using the php artisan wood:import
command, after which in your folder database
file wood.json
will appear. In it, you describe your files according to the scheme. Once the schema is complete, we call the php artisan wood:build
command to collect all the changes. And every time you change the schema, jason runs the php artisan wood:build
command.
php artisan wood:install
- Set the initial database for the generatorphp artisan wood:run
- Start generation processphp artisan wood:build
- Build data fromJSON
filephp artisan wood:import
- Import all data from table and createJSON
filephp artisan wood:sync
- Synchronize primary data of existing models into tables
<value>
- Data by default
{
"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"
}
]
}
We have extensive documentation in which you can get acquainted with the bfg wood.