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
740 stars 157 forks source link

How can I store resource path details, etc in corresponding json file and have create:{foo} commands act on them? #65

Open CyberiaResurrection opened 6 years ago

CyberiaResurrection commented 6 years ago

Environment:

Description:

To save more typing, and to further the idea that the code generator already embodies, how can I store (for example), the output directories for the generated controller(s), views, with/without form request, etc in the resource's resource.json file (eg BlogPost.json)?

Idea being when these are set in the resource file, the resource file version of whatever setting is used unless overridden by command line parameters. I've found this package to be very handy saving time when generating boilerplate for various bits, it's just that having to remember (and remember to type in) all the command line parameters (for a nontrivial Laravel app, I'm regularly having to type in at least 5).

Steps/Commands To Reproduce:

N/A

Content Of The Resource-File:

N/A

MikeAlhayek commented 6 years ago

If you’re planning on regenerating the resources over and over, the ‘php artisan create:mapped-resources’ command may come in handy. If you have not tried it yet, you may want to give it a shot. Otherwise, i’ll Try to figure something out to accommodate your thoughts on future releases

CyberiaResurrection commented 6 years ago

Sweet, thanks for the quick response. This is an awesome tool already - I only hope I can make it better.

I find I get a lot more done if I can rapidly iterate, try out new ideas, and chuck the bad ideas early. Tripping over missed or wonky command line arguments is not my idea of fun.

CyberiaResurrection commented 6 years ago

It's not just regenerating the resources over and over, it's regenerating them with a specific set of command-line options each time.

For example, on a project I'm hacking on currently:

create:controller Report --controller-directory=api --views-directory=api --with-form-request --form-request-directory=api/reports
create:migration Report --connection-name=sideways --engine-name=InnoDB --with-soft-delete

As experimentation and iteration can occur over multiple hours or even days, simply going through CLI history doesn't really work. Having to remember more than 7 command line options, and which part they fit into, would seem to be something that a computer can do better than squishy, fallible, meat.

MikeAlhayek commented 6 years ago

Yes I understand. We’ll add this request to the lab’s list.