/** * Applies any group settings to a route * * @param Route $route The route to apply the settings to * @return Route The route with the applied settings */ private function applyGroupSettings(Route $route) { $route->setRawPath($this->getGroupPath() . $route->getRawPath()); $route->setRawHost($this->getGroupHost() . $route->getRawHost()); if (!$route->usesClosure()) { $route->setControllerName($this->getGroupControllerNamespace() . $route->getControllerName()); } $route->setSecure($this->groupIsSecure() || $route->isSecure()); // The route's variable regexes take precedence over group regexes $route->setVarRegexes(array_merge($this->getVarRegexes(), $route->getVarRegexes())); $groupMiddleware = $this->getGroupMiddleware(); if (count($groupMiddleware) > 0) { $route->addMiddleware($groupMiddleware, true); } return $route; }