Support the ongoing development of Laravel.io →
Configuration
Last updated 1 year ago.
0

Environments flatten their values to a single level array.

Your expanded array is equivalent to this:

return array(
    'Foo' => array(
        0 => 'a',
        1 => 'b',
        2 => 'c',
    ),
);

which when flattened returns the results you show where nested keys are dot-appended to the root key. In your array the keys are implicit / numeric so the 0, 1, 2 etc. are added to the Foo key, separated by a period.

A better way to approach this might be to store an environment specific config file and read the actual array value from that - which won't be flattened unless you force it to be so.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

vcardillo vcardillo Joined 9 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.