fumeapp / modeltyper

Generate TypeScript interfaces from Laravel Models
MIT License
136 stars 16 forks source link

Add more options #33

Closed nurdism closed 1 year ago

nurdism commented 1 year ago

this pr adds 4 new options to the cli

--no-relations: Do not include relations --optional-relations: Make relations optional types --no-hidden: Do not include hidden model attributes --timestamp-strings: Output timestamps as strings

nurdism commented 1 year ago

this fixes #31 without breaking changes and addresses #32 as well

acidjazz commented 1 year ago

Thanks for the pr! reviewing shortly

acidjazz commented 1 year ago

@tcampbPPU what do you think about the TS date type expecting an object vs a Laravel endpoint response always coming back as a json - do we keep it an option to go text? or make the switch making it an option to make it a date?

nurdism commented 1 year ago

added another option --optional-nullables: Output nullable attributes as optional fields

tcampbPPU commented 1 year ago

yea I think union type works fine from @nurdism suggestion

acidjazz commented 1 year ago

@nurdism if you can please:

nurdism commented 1 year ago

@acidjazz updated the requested changes