Configuration File
The configuration of plugins is the same as that of regular Webman projects, but the settings for a plugin generally only apply to that specific plugin and do not affect the main project.
For example, the value of plugin.foo.app.controller_suffix
only affects the controller suffix of the plugin and has no impact on the main project.
Similarly, the value of plugin.foo.app.controller_reuse
only affects whether the plugin reuses controllers and does not impact the main project.
The value of plugin.foo.middleware
only affects the middleware used by the plugin and has no effect on the main project.
The value of plugin.foo.view
only affects the views used by the plugin and does not influence the main project.
The value of plugin.foo.container
only affects the container used by the plugin and has no bearing on the main project.
The value of plugin.foo.exception
only affects the exception handling class of the plugin and does not affect the main project.
However, since routes are global, the routes configured for the plugin will also affect the global routing.
Getting Configuration
The method to obtain a specific plugin configuration is config('plugin.{plugin}.{specific configuration}');
. For example, to get all the configurations in plugin/foo/config/app.php
, the method is config('plugin.foo.app')
.
Likewise, the main project or other plugins can use config('plugin.foo.xxx')
to obtain the configuration of the foo plugin.
Unsupported Configuration
Application plugins do not support server.php
or session.php
configurations, and do not support app.request_class
, app.public_path
, or app.runtime_path
configurations.