您可以使用mergeConfigFrom包的 ServiceProvider 的方法
/**
* Register bindings in the container.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(
__DIR__.'/path/to/config/courier.php', 'courier'
);
}
Run Code Online (Sandbox Code Playgroud)
解决了。
这是我使用的代码。
public function register()
{
if ($this->app['config']->get('custom_package') === null) {
$this->app['config']->set('custom_package', require __DIR__.'/../Config/config.php');
}
Run Code Online (Sandbox Code Playgroud)
在ServiceProvider为定制包。
| 归档时间: |
|
| 查看次数: |
505 次 |
| 最近记录: |