I'm wanting to modularize the app I'm building in Laravel so I've created the app/Modules directory. I currently have two modules with many more to come. Each Module has its own views included so I'm wondering if there is a way to register a wildcard path in the view config.
I can manually add each folder but that seems to be more work than necessary.
I've tried using basic wildcard replacement:
app_path('Modules/*/views'),
app_path('Modules/{*}/views'),
app_path('Modules/**/views'),
app_path('Modules/{**}/views'),
But none of these solutions do the trick. If I manually assign the path it serves my views as expected:
app_path('Modules/SomeModule/views'),
Any advice would be greatly appreciated.
Update: Found a good how to on modular development in Laravel. Using a service provider, you can set up a boot method that registers all the views directories you plan on using.
http://kamranahmed.info/blog/2015/12/03/creating-a-modular-application-in-laravel/
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community