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.

Maintainers

Details

github.com/bfg-s/wood

Source

Issues

Installs: 104

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 1

Open Issues: 0

Type:bfg-app

1.3.0 2023-12-24 18:07 UTC

README

Install

composer require bfg/wood

Description

Laravel's advanced framework controller for a code generation, change your framework quickly and easily. Automate all the same tasks with best code generator.

Json mode demo

Wood json demo

Quick start

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.

Commands

  • php artisan wood:install - Set the initial database for the generator
  • php artisan wood:run - Start generation process
  • php artisan wood:build - Build data from JSON file
  • php artisan wood:import - Import all data from table and create JSON file
  • php artisan wood:sync - Synchronize primary data of existing models into tables

JSON structure

  • <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"
        }
    ]
}

Application documentation

We have extensive documentation in which you can get acquainted with the bfg wood.

Application Demo

Wood demo

More details.

https://wood.veskod.com/