How to make plugin for package?
Can anyone share thoughts on how to handle and make a plug-in for a package? I have a package and want to make a stand alone plugin package for it. How do I go about it from the installation point of view? That is, do I copy the plugin files into the installed package during the plugin installation and then delete them on uninstalling the plugin or how else?
I don't want to have 2 separate packages: one without the plugin and one with it. And I don't want to make a new revision of the package with the plugin functionality, I want it to be installed separately if needed.
Any thoughts, suggestions, ideas?
The plugin will know about the package's functionality. But the package wouldn't have a clue about the plugin. The plugin will have to override some package's functionality and views. I've got no idea how or if that could be implemented.
You should be able to build your second package with a check on the install to make sure the first package is installed and then use it's functionality as you normally would.
This package has as example of the install check for another package - https://www.concrete5.org/marketplace/addons/page-redirect1...
Because the plugin package will always be installed after the main package, its code will also always be loaded after the main package's code so you can easily override any of the main classes by using Laravel's bind() in your plugin's controller on_start() funciton