public static function detectEnv(array $environments, $uri)
        {
            foreach ($environments as $environment => $patterns) {
                // Essentially we just want to loop through each environment pattern
                // and determine if the current URI matches the pattern and if so
                // we will simply return the environment for that URI pattern.
                foreach ($patterns as $pattern) {
                    if (Inflector::is($pattern, $uri) or $pattern == gethostname()) {
                        return $environment;
                    }
                }
            }
        }