Skip to content

refactor: migrate make:scaffold as modern command - #10567

Merged
paulbalandan merged 1 commit into
codeigniter4:4.8from
paulbalandan:scaffold-generator
Sep 19, 2026
Merged

paulbalandan merged 1 commit into
codeigniter4:4.8from
paulbalandan:scaffold-generator

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Description
Follow up to #10524 . This is the last framework command to be migrated into the modern command API.

A behavioral improvement over legacy: a missing class name will now be asked once instead of one per component.

This is currently branched from the make:migration PR and will be rebased once it merges.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@carson-codeigniter4 carson-codeigniter4 Bot added 4.8 PRs that target the `4.8` branch. refactor Pull requests that refactor code labels Sep 18, 2026
@paulbalandan
paulbalandan force-pushed the scaffold-generator branch 2 times, most recently from 646a538 to 448998a Compare September 18, 2026 08:54
@paulbalandan paulbalandan changed the title refactor: migrate make:scaffold to AbstractGeneratorCommand refactor: migrate make:scaffold as modern command Sep 18, 2026

@michalsn michalsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome.

@michalsn

Copy link
Copy Markdown
Member

Bottom line - I was thinking about adding a crud command to generate a full CRUD skeleton using plain HTML, without any styling. Of course, it could also support a custom "template" so the view layer could be adjusted as needed.

I probably won't have time to work on this in September, but I'm wondering whether this will now be possible, or whether things have become more complicated.

@paulbalandan

Copy link
Copy Markdown
Member Author

Do you mean something like a GUI?

@michalsn

Copy link
Copy Markdown
Member

In a way, yes. We already have scaffold, which only generates the basic files without any actual implementation.

The idea behind crud would be to generate a controller, model/entity, views, routes, etc, that work out of the box.

@paulbalandan

Copy link
Copy Markdown
Member Author

Ah yes. The modern command API will make it easier. It has added a lot of improvements over the legacy API, including composition of several commands. Some questions in mind are where would the data come from (from passed options I suppose) and should routes be added directly or just print and let the dev copy paste it.

@michalsn

Copy link
Copy Markdown
Member

Okay, that's encouraging.

Yes, data would come from input, like make:crud Post --fields=title:string,body:text. I suppose we can start by printing out routes, although I wonder if 4.8 is not the right moment to move toward auto-routes (improved) being the default option for the framework.

@paulbalandan

Copy link
Copy Markdown
Member Author

On flipping to auto improved, I'd defer this to an issue for its own discussion. For one it would need to update the Routes file and there is I believe an open issue for the mode's extensibility.

For crud itself, I'd suggest we keep the current way so that the generated files would work out of the box. Then, add an option for auto routes if needed, which would update the generated controller's method names.

@michalsn

Copy link
Copy Markdown
Member

Oh... yes, changing routes would be a totally different PR. I was just thinking out loud.

@paulbalandan
paulbalandan merged commit 602733d into codeigniter4:4.8 Sep 19, 2026
58 checks passed
@paulbalandan
paulbalandan deleted the scaffold-generator branch September 19, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.8 PRs that target the `4.8` branch. refactor Pull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants