Repository navigation
feat(install): migrate app folders into the layers - #50
Merged
Merged
Conversation
danielebarbaro
force-pushed
the
feat/install-migrate-app
branch
from
November 16, 2026 13:09
0117991 to
0ed1d19
Compare
danielebarbaro
force-pushed
the
feat/no-classes-outside-layers
branch
from
November 16, 2026 13:09
768e2cf to
d0f8999
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #49, merge that first.
Running
clean-arch:installon an existing app creates the new layer folders but moves nothing. With a starter kit you end up with two base controllers, duplicatedMiddlewareandRequestsfolders, andapp/Actionsstill outside the layers.This adds
clean-arch:install --migrate-app, which moves the existing code into the layers:app/Http/Controllers,Http/Middleware,Http/Requests,Http/ResourcesInfrastructure/Http/...Console/CommandsInfrastructure/Console/CommandsMail,Notifications,Observers,ExportsInfrastructure/...Actions,Services,Jobs,Listeners,ConcernsApplication/...Models/User.php(only if it's the only model)Domain/Users/Models/User.phpWhat it does along the way:
app/,bootstrap/,config/,database/,routes/andtests/.Controllerwith the oneinstallwrites.bootstrap/app.php, or prints the lines to add if it can't do it safely.resources/jsandresources/ts.--force.Providers,Policies, other models,Livewire) are left alone.It also fixes a bug in
--user-in-domain: references with a leading backslash, like\App\Models\User::class, were not rewritten. It now scansbootstrap/too.Tested by migrating a copy of the Laravel React starter kit and running
phparkitect checkon it with the rule from #49 turned on.Limits: paths inside strings like
app_path('Http/...')aren't rewritten, non PHP files aren't touched (except Wayfinder imports), andusestatements aren't re sorted, so run Pint afterwards. Not tried on the Vue and Livewire kits yet.Nothing changes without the new flag. Minor release.