Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: need to adjust generate from table output #308

Open
madsynn opened this issue Sep 20, 2016 · 3 comments
Open

[Feature]: need to adjust generate from table output #308

madsynn opened this issue Sep 20, 2016 · 3 comments

Comments

@madsynn
Copy link

madsynn commented Sep 20, 2016

The first item generated is the id:increments and its being generated like "fieldInput": "id:integer,true,true", and reverse these two. "inForm": true, "inIndex": false

    {
        "fieldInput": "id:increments",
        //** "fieldInput": "id:increments:guarded ",   //** possible
        "htmlType": "number",
        "validations": "",
        "searchable": false,
        "fillable": false,
        "primary": true,
        "inForm": false,
        "inIndex": true
    },

just thinking outside the box but maybe we can add a protected / guarded option for the fields and a protected option to the dates. to output into the model or i guess just add it regardless to all models.

Model.php

protected $guarded = ['id'];
protected $dates = ['published_at', 'deleted_at'];

Also on the date fields you should change to false by default.

{
        "fieldInput": "created_at:dateTime",
        "htmlType": "date",
        "validations": "",
        "searchable": true,
        "fillable": false,
        "primary": false,
        "inForm": false,
        "inIndex": false
    },
@madsynn
Copy link
Author

madsynn commented Sep 20, 2016

I also noticed in your sample file you have it formatting the fields like this:

 {
        "name": "updated_at",
        "dbType": "timestamp",
        "htmlType": "",
        "validations": "",
        "searchable": false,
        "fillable": false,
        "primary": false,
        "inForm": false,
        "inIndex": false
    }

but in the actual output from table they are formatted like this:

  {
        "fieldInput": "id:integer,true,true",
        "htmlType": "number",
        "validations": "",
        "searchable": false,
        "fillable": false,
        "primary": true,
        "inForm": true,
        "inIndex": false
    },

What is this are is it now part of the generator?

 "dbType": "",
 "type": "",
 "relation": ""

if they are now part of it i would format the main sample file to copy the new format accordingly weather they are used on everyfield or not. Its getting a bit confusing. Also in relation fields we should add 2 more options for update and delete "cascade"

  {
        "fieldInput": "id:guarded",
        "dbType": "increments",
        "htmlType": "number",
        "validations": "",
        "searchable": false,
        "fillable": false,
        "primary": true,
        "inForm": true,
        "inIndex": false,
        "type": "relation",
        "relation": "1tm,Feature",
        "update": "cascade",
        "delete": "cascade"
    },

@ShaileshInfyom
Copy link
Contributor

@madsynn it's already there, also dbType is supported and you can specify it.
image

relationship you can define like dbType": "integer:unsigned:foreign,users,id

@ShaileshInfyom ShaileshInfyom changed the title need to adjust generate from table output [Feature] need to adjust generate from table output Jan 28, 2022
@ShaileshInfyom ShaileshInfyom changed the title [Feature] need to adjust generate from table output [Feature]: need to adjust generate from table output Jan 28, 2022
@ShaileshInfyom
Copy link
Contributor

@madsynn at the moment we don't have any support related to guarded but we will keep in our queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants