Closed timoteo7 closed 5 years ago
@timoteo7 Can you paste your resources/js/example.json
here? Also, specify which version of laravel and generator you are using?
Laravel is 5.8 "infyomlabs/laravel-generator": "5.8.x-dev", "infyomlabs/swagger-generator": "dev-master",
[ { "name": "id", "htmlType": "", "dbType": "increments", "validations": "", "searchable": false, "fillable": false, "primary": true, "inForm": false, "inIndex": false }, { "name": "titulo", "htmlType": "text", "dbType": "string,190", "validations": "required" }, { "name": "periodo", "htmlType": "number", "dbType": "smallint:unsigned:nullable" }, { "name": "bonus", "htmlType": "number", "dbType": "decimal,10,2:unsigned:nullable" } ]
@timoteo7 when you are generating crud from files, it needs to have timestamps fields. But if are using CLI then timestamps are not needed, but when we save a file, we store timestamp fields there. so add timestamps fields in your JSON file and it should work.
{
"name": "created_at",
"dbType": "timestamp",
"htmlType": null,
"validations": null,
"searchable": false,
"fillable": false,
"primary": false,
"inForm": false,
"inIndex": false
},
{
"name": "updated_at",
"dbType": "timestamp",
"htmlType": null,
"validations": null,
"searchable": false,
"fillable": false,
"primary": false,
"inForm": false,
"inIndex": false
}
in
config/infyom/laravel_generator.php
i do:
php artisan infyom:migration example --fieldsFile="resources/js/example.json"
the result in my migration is:
i'm having to manually put
$table->timestamps();
i did something wrong not to go automatically?