public function loadEnvironmentConfigurations($app, RepositoryContract $repository)
    {
        $configPath = realpath($app->environmentPath());

        $files = $this->getConfigurationFilesInPath($configPath);

        foreach ($files as $scope => $path) {
            $items = require $path;

            foreach ($items as $key => $value) {
                $key = "{$scope}.{$key}";

                // We can use a Closure as the value, and it will be called with
                // the default configuration item. It useful for replace configurations
                // defined as array or other complex form.
                if ($value instanceof Closure) {
                    $value = $value($repository->get($key), $app);
                }

                // We can specify a deep-level configuration item using the dot in key,
                // and just to change the item.
                $repository->set($key, $value);
            }
        }
    }