Skip to content

bfg-s/wood

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Extension laravel wood

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/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages