I am trying to load the local version of my database.php file located in my app/config/local directory. I have setup my $env environment detection in start.php for local.
$env = $app->detectEnvironment(array(
'local' => array('your-machine-name')
));
The correct environment appears to be detecting correctly as the result of using:
App::environment('local')
evaluates as TRUE, however it only loads the default database.php in the app/config directory.
Just in case it was still related to detection I have tried just hardcoding local as the environment, but it has the same effect.
$env = $app->detectEnvironment(function()
{
return 'local';
});
I also tried using a different name for the environment in case 'local' had some undocumented reserved meaning.
I have successfully setup environments in other projects using Laravel 4, and I can't work out for the life of me what is different in this case. I'd appreciate any suggestions on what could lead to this behaviour.
The local environment is run on MAMP.
I just did an additional test and found that app.php file in my local folder loaded correctly. It is only the local database.php file that does not appear to be loading.