laravel/framework — pull request #6845 by fsieduc (2014-12-29 16:08:39+00:00)
Title: BUG? in LoadConfiguration.php

Think found a bug.

Since

Finder::create()->files()->name('*.php')->in($app->configPath())

goes deep in config/ folder, it will found all files named "X.php" bellow it.

For example if I have 3 environments (local, staging and testing) :
[...]/config/X.php
[...]/config/local/X.php
[...]/config/staging/X.php
[...]/config/testing/X.php
etc.

But $files will contains just one winner : the last one (depending on the sort done by Finder), so $files will be in this case :

$files["X"] == "[...]/config/testing/X.php"

And this will happen even if .env says APP_ENV=local.

I think that this is not what you really want.