public function detectControllerClass($name = null)
    {
        // The path must begin with the config dir
        if (!preg_match('#^'.$this->dir.'#i', $this->path, $matches)) {
            return false;
        }

        // Find the controller from the end of the path
        if (!$name) {
            $name = $this->detectControllerName();
        }

        // Form the namespaced controller
        return Str::studly($name);
    }