laravel-api-generator
laravel-api-generator copied to clipboard
Question rememberToken, enum and select?
I am looking through your docs and I do not see the option for rememberToken, enum and select? Is this an option or can you tell me the way do make it with your --fields-file format
select is supported. you can check fields format here
you need to add rememberToken manually after generator finishes with skipping migration at last. And also enum is not supported as of now.
Also I try to use these and they do not output like they are supposed to. FIELDS-FILE
{ "field":"role_id:integer:unsigned:foreign:references,id:on,roles:onDelete,cascade", "type":"select", "validations": "" }, { "field":"location:string", "type":"select:Surat,Mumbai", "validations": "" }
OUTPUTS:
$table->integer('role_id')->unsigned()->foreign()->references('id')->on('roles')->onDelete('cascade'); $table->string('location');
:bulb: Maybe restructure it something like this:
FIELDS-FILE
{
"field":"role_id:integer:unsigned: :references,id:on,roles:onDelete,cascade",
"type":"foreign",
"validations": ""
},
{
"field":"location:select",
"type":"options:Surat,Mumbai",
"validations": ""
},
{
"field":"location:enum",
"type":"options:Surat,Mumbai",
"validations": ""
},
:bulb: Idea: you could make new custom code for the rememberToken just like you do the --softDeletes --rememberToken
or this
{
"field":"remember",
"type":"token",
"validations": ""
}
:bulb: JUST IDEAS NOTHING MORE :bulb:
remeberToken is done in develop branch.
Thank you I am already using it. Perfect. I have another you should add with the proposed above.
--innodb : Adds: $table->engine = 'InnoDB';
or
{
"field":"engine",
"type":"innodb",
"inTableView":"false", /* (proposed also to include in index table or not) */
"validations": ""
}