/** * Validate a given rule against a route and request. * * @param \Nova\Routing\Route $route * @param \Nova\Http\Request $request * @return bool */ public function matches(Route $route, Request $request) { if ($route->httpOnly()) { return !$request->secure(); } elseif ($route->secure()) { return $request->secure(); } return true; }
/** * Get the scheme for the given route. * * @param \Nova\Routing\Route $route * @return string */ protected function getRouteScheme($route) { if ($route->httpOnly()) { return $this->getScheme(false); } else { if ($route->httpsOnly()) { return $this->getScheme(true); } } return $this->getScheme(null); }