I am developing several packages and would like to have a single config file for all of them if they are to be published.
Inside my service provider I did this:
public function boot()
{
$this->publishes([
__DIR__ . '/config/custom.php' => config_path('custom.php'),
]);
}
public function register()
{
$this->mergeConfigFrom(
__DIR__ . '/config/custom.php', 'custom'
);
}
Config:
return [
'containers' => [
...
]
];
And surely enough, if I publish it, it creates the file with values inside. But if a file already exists, having different keys:
return [
'xxxyyy' => [
...
],
];
publishing doesn't do anything. I would expect it to look like:
return [
'xxxyyy' => [
...
],
'containers' => [
...
]
];
What am I doing wrong?