diff --git a/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php b/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php index ab05e0b60e14..c5f331ae7dd3 100644 --- a/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php +++ b/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php @@ -92,8 +92,11 @@ protected function loadConfigurationFile(RepositoryContract $repository, $name, if (isset($base[$name])) { $config = array_merge($base[$name], $config); - if (($option = $this->smartMergeOption($name)) && isset($config[$option])) { - $config[$option] = array_merge($base[$name][$option], $config[$option]); + + foreach ($this->mergeableOptions($name) as $option) { + if (isset($config[$option])) { + $config[$option] = array_merge($base[$name][$option], $config[$option]); + } } unset($base[$name]); @@ -105,23 +108,22 @@ protected function loadConfigurationFile(RepositoryContract $repository, $name, } /** - * Return the option within the configuration file - * which allows another level of merging. + * Get the options within the configuration file that should be merged again. * * @param string $name - * @return string|null + * @return array */ - protected function smartMergeOption($name) + protected function mergeableOptions($name) { return [ - 'broadcasting' => 'connections', - 'cache' => 'stores', - 'database' => 'connections', - 'filesystems' => 'disks', - 'logging' => 'channels', - 'mail' => 'mailers', - 'queue' => 'connections', - ][$name] ?? null; + 'broadcasting' => ['connections'], + 'cache' => ['stores'], + 'database' => ['connections'], + 'filesystems' => ['disks'], + 'logging' => ['channels'], + 'mail' => ['mailers'], + 'queue' => ['connections'], + ][$name] ?? []; } /**