laravel-api-generator icon indicating copy to clipboard operation
laravel-api-generator copied to clipboard

Question rememberToken, enum and select?

Open phillipmadsen opened this issue 9 years ago • 4 comments

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

phillipmadsen avatar Sep 03 '15 22:09 phillipmadsen

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.

mitulgolakiya avatar Sep 04 '15 06:09 mitulgolakiya

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:

phillipmadsen avatar Sep 04 '15 20:09 phillipmadsen

remeberToken is done in develop branch.

mitulgolakiya avatar Sep 19 '15 10:09 mitulgolakiya

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": ""
}

phillipmadsen avatar Sep 25 '15 21:09 phillipmadsen