http://sky.pingpong-labs.com/docs/master/modules I'm using this package for modules, it's easy to use.
Content Management System using Laravel 5 - looking for advice
I have been struggling to get Laravel's approach to code organization clear in my mind. I'm developing a CMS which will support templates and plug-in modules.
-
Each template will be packaged up as a library so they can be installed via composer (from a private Git repo). I have this part clear in my mind.
-
The CMS will also support "modules", essentially plug-n-play functionality to be added to the system and the exact modules will vary from site to site. Each module will be a Laravel package installable via composer.
What I'm not clear on is exactly how to model and namespace the different components. Since I want the CMS to enforce some consistency across all templates and all modules, I was thinking of having a Contract for each.
/vendor/package/src/CMSServiceProvider.php
/vendor/package/src/Contracts/Module.php
/vendor/package/src/Contracts/Template.php
Templates will only have public assets, no controller or other code. Modules, however, will have the full MVC complements.
Where my head begins to hurt is that each module, for example, is a full L5 package, so how do I incorporate the Module contract so that the module itself is governed by it? Do I "implement" the contract as part of the ServiceProvider class? Do I have a "ModuleServiceProvider" interface instead of just "Module" so that it's self-documenting? I don't like to mix terminologies and conventions. If something is related to ServiceProvider, then it makes sense to follow the Laravel naming convention.
Your feedback is very much appreciated here.
Please or to participate in this conversation.