Closed phillipmadsen closed 8 years ago
Anyway this would make this stand out above the others. Just want to know your thoughts on it.
you could even add a level up in the fields file that would make all this easier. example
fields-file.json:
[
{
"model":"Post",
"relationship": "Post:BelongsTo:Category",
{
"fieldInput": "id:increments",
"htmlType": "",
"validations": "",
"searchable": false,
"fillable": false,
"primary": true,
"inForm": false,
"inIndex": false
},
{
"fieldInput": "content:text",
"htmlType": "textarea",
"validations": "required",
"searchable": true,
"inForm": true,
"inIndex": true
},
{
"fieldInput": "category:string",
"htmlType": "MODELSELECT",
"searchable": true,
"fillable": true,
"primary": index,
"inForm": true,
"inIndex": false,
"ModelToUse": 'Category',
"ColumnSelector": 'title'
},
{
"fieldInput": "post_date:dateTime",
"htmlType": "date"
},
},{
"model":"Category",
"relationship": "Category:HasMany:Post"
{
"fieldInput": "id:increments",
"htmlType": "",
"validations": "",
"searchable": false,
"fillable": false,
"primary": true,
"inForm": false,
"inIndex": false
},
{
"fieldInput": "title:string",
"htmlType": "text",
"searchable": true,
"fillable": true,
"primary": index,
"inForm": true,
"inIndex": true
},
{
"fieldInput": "content:text",
"htmlType": "textarea",
"validations": "required",
"searchable": true,
"inForm": true,
"inIndex": true
},
}
]
Maybe a command to generate the fields-file.json framework would be greate also.
php artisan infyom:fields-file Post or php artisan infyom:fields-file:parent-child Category SubCategory
generates category-subcategory.json - skeleton
[
{
"model":"Post",
"relationship": "Category:HasMany:SubCategory",
{
"fieldInput": "id:increments",
"htmlType": "",
"validations": "",
"searchable": false,
"fillable": false,
"primary": true,
"inForm": false,
"inIndex": false
},
},{
"model":"Category",
"relationship": "SubCategory:BelongsTo:Category"
{
"fieldInput": "id:increments",
"htmlType": "",
"validations": "",
"searchable": false,
"fillable": false,
"primary": true,
"inForm": false,
"inIndex": false
},
{
"fieldInput": "category_id:integer:unsigned",
"htmlType": "foreign:index",
"validations": "",
"searchable": false,
"fillable": true,
"primary": false,
"inForm": false,
"inIndex": false
}
}
]
@phillipmadsen This can be a part of foreign key & relationships.
Do you have any ideas on something like this. This seems to be the bottleneck in development so if we could make it easier it would be very useful to everyone. Example of what I am talking about would be. _SECTIONS EXAMPLE_
_FIELDS_
_OR COMBINED_
maybe add models to use to make it easier.
AND A SELECT FIELD GETTING DATA FROM ANOTHER MODEL
something along the lines of the repeating row you have in your generator html.