2 approaches
- have a small bash script that adapts your .env pr client
- have a speficif config that you put in config directtory and get via config() function
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi there, artisans!
I am working on a Laravel application (duhh) which I might use for multiple clients.
This setup requires that config files in the config folder are flexible. I want to change them for each client. I know, things like keys should be put in the .env file, but passing lists or other configs are not suitable for the .env file. I want to pass them right in the config file (or even better, a yaml file...).
My question is; what is the promoted way to make this happen (apart from the .env file)?
Thank you in advance!
Regards, Bob
point 1 : with sed you can change values as your want for example
point 2 : https://laravel.com/docs/8.x/configuration#introduction
All of the configuration files for the Laravel framework are stored in the config directory.
You can add your specific config file et get the data the same way as the others.
Please or to participate in this conversation.