Laravel configuration files per environment
You can define configurations per environment
1. Set the environment in apache: SetEnv LARAVEL_ENV local
2. I defined an override application.php in /application/config/local and dev, test and prod
Then I can access as follows:
$myConfigValue = Config::get('application.myConfigValue');
Then pass to view as follows
return View::make('home.index')->bind("myConfigValue", $myConfigValue);
Here's what the config files looks like in /application/config/local
return array(
// Url for local
'url' => 'http://localhost',
'myConfigValue' => 'yesDoIt'
);
Of course, see the laravel documentation for all this and more.
1. Set the environment in apache: SetEnv LARAVEL_ENV local
2. I defined an override application.php in /application/config/local and dev, test and prod
Then I can access as follows:
$myConfigValue = Config::get('application.myConfigValue');
Then pass to view as follows
return View::make('home.index')->bind("myConfigValue", $myConfigValue);
Here's what the config files looks like in /application/config/local
return array(
// Url for local
'url' => 'http://localhost',
'myConfigValue' => 'yesDoIt'
);
Of course, see the laravel documentation for all this and more.
Comments
Post a Comment