CrestApps / laravel-code-generator

An efficient Laravel code generator, saving time by automating the creation of resources such as views, controllers, routes, migrations, languages, and form-requests. Highly flexible and customizable, it includes a cross-browser compatible template and client-side validation for application modernization.
https://laravel-code-generator.crestapps.com
MIT License
738 stars 158 forks source link

possible un-necessary duplication of mappings #89

Closed LoganGray closed 5 years ago

LoganGray commented 5 years ago

https://github.com/CrestApps/laravel-code-generator/blob/8823b07c03333d561d342f4cd4875a8cd1d9674f/config/codegenerator.php#L685

Hello, If you look carefully you'll see a number of duplicates in the array: eloquent_type_to_html_type in codegenerator.php

examples highlighted in pic (gotta love PhpStorm!):

image

MikeAlhayek commented 5 years ago

Although the code can use some clean up, don’t think these are duplicate. This mapping are used to convert eloquent methods into html. And all the highlighted methods like smallInteger, integer, and bigInteger are different and should have mapping to the generator knows what html type it should create.

LoganGray commented 5 years ago

but it looks like you have duplicate key => value pairs.

like:

'tinyInteger' => 'number', 'tinyInteger' => 'number',

and

'unsignedBigInteger' => 'number', 'unsignedBigInteger' => 'number',

MikeAlhayek commented 5 years ago

I see that now. Sorry missed it earlier.

Feel free to make the change if you like, otherwise i’ll Clean it up when I get back into the code

LoganGray commented 5 years ago

okay - I'll take care of it for you. Look for a PR tomorrow. (I'm at work, and want to leave now) .

Happy Weekend!

MikeAlhayek commented 5 years ago

Thank you

MikeAlhayek commented 5 years ago

Additionally, I uploaded the doc site on GitHub https://github.com/CrestApps/crestapps-site Feel free to update the docs if needed.