pqrs / l5b-crud

CRUD artisan command for rappasoft/laravel-5-boilerplate
21 stars 15 forks source link

Add command options to enable/disable to choose which elements are created #1

Closed pqrs closed 5 years ago

pqrs commented 5 years ago

Some ideas:

php artisan l5b:crud example -m

would create just the models/Model.php file, skipping the rest. Or maybe we should use it to disable the Model creation while doing the rest.

pqrs commented 5 years ago

Implemented --migrate option (or just -m) to run the migration after creating all the files.

drjekyll commented 5 years ago

I would also like an option to specify the default table column that gets created. I don't have much need for "title", but I frequently need a column called "name". If I could specify that, then there would be less tedious editing. Or, if not a command option for it, then maybe change the default from "title" - which is also used for other things, to something easy to find and replace that's not likely used elsewhere - like "foobar".

pqrs commented 5 years ago

Hi @drjekyll, that's a nice idea, easy to implement and really useful. I'd prefer a command option rather than the search and replace way, even with an easier name.

So, the syntax would be something like:

l5b:crud {name} {--f|field=title} {--m|migrate}

where 'title' is the default value for the database field and would be replaced for whatever other you may write, i.e.:

l5b:crud Test -f=name

I'll try to implement this between today and tomorrow. Thanks for your idea!

pqrs commented 5 years ago

It's done. You can test it now with latest release 1.3.4. I have not tested myself yet so maybe it has some errors.