public function guard($loginRoute = null)
    {
        $base = Base::instance();
        $currentPath = $base['PATH'];

        $this->parseFirewalls();

        if (
            $this->firewalls['pattern']
            && preg_match($this->firewalls['pattern'], $currentPath, $matches)
        ) {
            $key = static::pathName($matches['path']);
            $config = $this->firewalls['paths'][$key];

            if (!$this->isGranted($config['roles'])) {
                $base->reroute($loginRoute ?: $config['login_route']);
            }
        }

        return $this;
    }