Closed pqrs closed 5 years ago
Implemented --migrate option (or just -m) to run the migration after creating all the files.
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".
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!
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.
Some ideas:
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.