I have the following setup with Laravel 4.2:
bootstrap/start.php (hostname correct, environment is local)
$env = $app->detectEnvironment(array(
'production' => array('produrl'),
'local' => array('MBP-Ivo.local', 'iMac-Ivo.local'),
(in project root, .env.php is exactly the same except mysql info)
// Code variables
'mysqlUsername' => 'user',
'mysqlPassword' => 'password',
'mysqlDatabase' => 'database',
'paymentIdeal' => false,
'shipmentCountries' => [
'Nederland' => 'Nederland',
'Belgie' => 'Belgie'
(I don't overwrite with app/config/local/app.php)
'paymentIdeal' => $_ENV['paymentIdeal'],
'shipmentCountries' => $_ENV['shipmentCountries']
There are some more variables, but the problem is with shipmentCountries
Undefined index: shipmentCountries
All variables declared are working (eg paymentIdeal), but shipmentCountries gives an error. I think because it's an array? The name is exactly the same everywhere, including capital letters.
Does anyone know why I can't get this working?
BTW: I'm choosing this option to prevent users having to change their application configs. I want to use only one *.env file to configure all important stuff. And yes, I know these values could be saved to the database, but that's for later :)
When I dump the $_ENV, I get the following:
[mysqlUsername] => ***
[mysqlPassword] => ***
[mysqlDatabase] => ***
[shipmentCountries.Nederland] => Nederland
[shipmentCountries.Belgie] => Belgie
Somehow it "flattens" the array shipmentCountries. Anyone knows how and why?