Create a Plugin System in Laravel CMS project
Hello laravel developers,
this is first post for me and hope someone help me in my issue.
I developing CMS by laravel 5.5 and i have 3 main module as follow:
- layout (in this module i define my layout [rows + cols] and then inject plugin please have look to below image). layout
- post/page in this module i choose one of my layout that i have created, also it should call plugin that existing in attached layout.
- i will store my plugin as blade template Plugin>main-content.balde.php
Problem:
now when page or post opening i want to load the layout and mapping the plugin and i want to do this automatically without (if or else) statement
layout design
Idea:
one of idea i have to use view composer but as you see the name of plugin will be loaded from database and of course it will be changed regarding to layout.
sec idea to use laravel package, design plugin as package
third, create helper function and will be loaded in layout and this function will do the mapping but, here is the important question can i do helper function that connect directly to model without controller ?
from Laravel Questions and Answers https://laravelquestions.com/php/create-a-plugin-system-in-laravel-cms-project/
via Lzo Media
No comments:
Post a Comment