-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
56 autoloading enhancements #58
Conversation
Draft PR, would be helpful if you could test it out in your project, @pelmered. Update the composer.json require to: "lunarstorm/laravel-ddd": "dev-56-autoloading-enhancements" And Then ensure config file is updated to contain an Custom filter callback via When I tested all of this against your cloned |
Thanks a lot @JasperTey! I will try this out now. |
It seems to work well. I had some other issues related to the autoload in our CI pipeline, but it turned out that I could fix that as well with theses changes. |
Added
ddd.autoload_ignore
), or register a custom filter callback viaDDD::filterAutoloadPathsUsing(callable $filter)
.Changed
cache:clearing
event, so thatddd:cache
yields consistent results no matter which order it runs in production (before or aftercache:clear
oroptimize:clear
commands).Ignoring Paths During Autoloading
To specify folders or paths that should be skipped during autoloading discovery, add them to the
ddd.autoload_ignore
configuration option. By default, theTests
andMigrations
folders are ignored.Paths specified here are relative to the root of each domain. e.g.,
src/Domain/Invoicing/{path-to-ignore}
. If more advanced filtering is needed, a callback can be registered usingDDD::filterAutoloadPathsUsing(callback $filter)
in your AppServiceProvider's boot method: