I am developing a Laravel Package which installs a list of dependencies. The dependencies have their own configuration files to be published after installation.
What we need is to auto (to avoid doing it manually) modify the config files of these dependencies by our package before/after publishing them and placing them in app/config.
I found some solutions like using mergeConfigFrom()
in register method of Package's service provider. But it doesn't modify file content itself, just loads the merged config.
We need to modify config file's content by the package that we developing so that we don't need to change config file manually after package installation.
For example, we install Laravel Horizon as a dependency the our package. Horizon publishes a config file called horizon.php
in app/config. We need to auto modify some values for app/config/horizon.php before or after publishing that config file.
Any help will be much appreciated. Thanks :)
This is currently not possible. Look at Illuminate\Foundation\Console\VendorPublishCommand
in the laravel framework source code.
horizon.php
config in your package by publishing it on the same file. horizon.php