public function replacePatterns($path)
    {
        $base = $this->getBasePath();

        // Replace folder patterns
        return preg_replace_callback('/\{[a-z\.]+\}/', function ($match) use ($base) {
            $folder = mb_substr($match[0], 1, -1);

            // Replace paths from the container
            if ($this->container->has($folder)) {
                $path = $this->container->get($folder);

                return str_replace($base, null, $this->unifySlashes($path));
            }

            // Replace paths from configuration
            if ($custom = $this->getPath($folder)) {
                return $custom;
            }

            return false;
        }, $path);
    }