InfyOmLabs / generator-builder

InfyOm Laravel Generator GUI Builder
http://labs.infyom.com/laravelgenerator/
MIT License
133 stars 71 forks source link

txtDbValue always hidden #57

Open thewebartisan7 opened 4 years ago

thewebartisan7 commented 4 years ago

There is a reason why the txtDbValue is always hidden?

This https://github.com/InfyOmLabs/generator-builder/blob/master/views/field-template.blade.php#L29

Should be appended to dbType like for htmlType and htmlValue

I can make a PR to:

1) Make this field .txtDbValue always visible

2) Add in form submit:

                // Append db value
                var dbType = $this.find('.txtdbType').val();
                // if not empty append
                if($this.find('.dbValue').val())  dbType = dbType + ':' + $this.find('.dbValue').val()

// ...

fieldArr.push({
                    name: $this.find('.txtFieldName').val(),
                    dbType: dbType, // here dbType
                    htmlType: htmlValue,
//...

And I would like to know about relation for each field as in your fields_sample.json there is for example:

    {
        "name": "writer_id",
        "dbType": "integer:unsigned:default,0:foreign,writers,id",
        "htmlType": "text",
        "relation": "mt1,Writer,writer_id,id"
    },

Right now seem not possible to add relation like this for each field, or am I missing something?