Using Dot Env files to manage settings
Wow. Included in Laravel http://laravel.com/docs/configuration#protecting-sensitive-configuration
removed due to old news
http://mattstauffer.co/blog/laravel-forge-using-environment-variables-for-environment-detection/
Update
I really like the second link and how it sets up a .env file first to just return a simple string. After that you can have the .env.production.php or .env.local.php that laravel can look for.
//bootstrap/start.php
$env = $app->detectEnvironment(function()
{
if (file_exists(__DIR__ . '/../.env')) {
return include(__DIR__ . '/../.env');
} else {
return 'production';
}
});
Quite simple at that point to separate all of the environments.
comments powered by Disqus