I'm currently looking for a framework to support my own new framework. Laravel seems to be my best choice.
I have a very specific structure in mind. My project will have a base design with common models, views and controllers, as well as some sub projects with there specific views. The goal is to provide a platform for owners of the same business, where we provide a unique website. In many cases only the design varies, whilst the structure and components stay the same. My idea was to create a maintainable structure on laravel wich every sites pulls its models, controllers and views from and if there is a specific need an additional view can be created.
Has somebody had experience with a simular project in the past?
I see some major obstacles:
- Creating sub projects
- Using multi database connections
- Using models and views from the main project
Laravel is very flexible and highly configurable, you should have no problem doing things like that at all. As for the database, for example, you can create two connections:
main, a fixed connection to your main database tables, andprojectfor the current project tables, here's what it should look like:And you should be able to:
Configure model connection:
Query connections directly:
Configure the database in run time:
As for the views, you can tell Laravel to find views wherever you need by simply doing: