Is overriding base config with environment config available in OC3?

I used a nice feature in OC1 where if I had an config key under local/config.php it would overridde the base config.php value when on local. I see that is not working out of the box in OC3.

The docs for OC1 is here

Was is discarded on purpose?
Does anyone has any workarounds for this?

Hi and welcome @bogdanb

For your example, you’d use a .env.local file instead which overrides specific values inside your .php config files, which are now a single source of truth in terms of configuration. This is the suggested approach provided by Laravel.

So if a config value exists in PHP as:

'database' => env('DATABASE_NAME', 'bar')

The production value in .env could be

DATABASE_NAME=prod

And the local value in .env.local could be

DATABASE_NAME=test

The documentation mentions it here:

2 Likes