It's very easy to port Laravel 5's way of handling environment files to Laravel 4.

You've got to require this package (it's that one that L5 uses): [code]composer require vlucas/phpdotenv[/code]

And then you should update bootstrap/start.php:

[code lang="php"] ... $dotEnv = new Dotenv\Dotenv(DIR . '/../'); $dotEnv->load();

$env = $app->detectEnvironment(function () { return getenv('APP_ENV') ?: 'production'; }); ... [/code]

And boom, done! Now you can use an .env-file instead of .env.php.