/** * Add the necessary where clauses to the route based on its initial registration. * * @param \Illuminate\Routing\Route $route * @return \Illuminate\Routing\Route */ protected function addWhereClausesToRoute($route) { $where = isset($route->getAction()['where']) ? $route->getAction()['where'] : []; $route->where(array_merge($this->patterns, $where)); return $route; }
/** * @param Router $route * * @return $this */ protected function addResponseType(Router $route) { return $route->where('type', '\\.[a-z]+'); }
/** * Add the necessary where clauses to the route based on its initial registration. * * @param \Illuminate\Routing\Route $route * @return \Illuminate\Routing\Route */ protected function addWhereClausesToRoute($route) { $route->where(array_merge($this->patterns, array_get($route->getAction(), 'where', []))); return $route; }
/** * Add a route to the appropriate route collection. * * @param array $methods * @param array $versions * @param string $uri * @param mixed $action * * @return \Illuminate\Routing\Route */ public function addRoute(array $methods, array $versions, $uri, $action) { $this->createRouteCollections($versions); $route = new Route($methods, $uri, $action); $route->where($action['where']); foreach ($versions as $version) { $this->routes[$version]->add($route); } return $route; }