Get the URI, methods, and action from the route.

@param mixed                    $route
@param \Illuminate\Http\Request $request

@return array
169868
public function getRouteProperties($route, Request $request)
    {
        if (method_exists($route, 'uri') && method_exists($route, 'methods')) {
            return [$route->uri(), $route->methods(), $route->getAction()];
        }

        return [$route->getUri(), $route->getMethods(), $route->getAction()];
    }
813167
public function getFromRequest($route = null) {
        $resolvers = [];
        foreach ($this->segmentsResolvers as $key => $resolverClass) {
            if( $bindedClass = request()->route($key) ) {
                $resolvers[$key] = new $resolverClass($bindedClass);
            }
        }
        // sort resolvers in same order they are in request
        if (!empty($resolvers)) {
            if (empty($route)) {
                $route = \Route::getCurrentRoute()->uri();
            }       
            $segments = explode('/', $route);
            $sortedResolvers = [];
            foreach($segments as $segment) {
                $segment = trim($segment, "{}");
                if (isset($resolvers [$segment])) {
                    $sortedResolvers[$segment] = $resolvers[$segment];
                }
            }
            $resolvers = $sortedResolvers;
        }
        return empty($resolvers) ? false  : $resolvers;
    }
264037
public function handle(Request $request)
    {
        $pathInfo = $request->getPathInfo();

        if (0 === strpos($pathInfo, $this->basePath)) {
            foreach ($this->routes as $config) {
                list($method, $pattern, $controller) = $config;

                if ($request->getMethod() === strtoupper($method)
                    && preg_match('!^' . preg_quote($this->basePath . $pattern, '!') . '$!', $request->getPathInfo())
                ) {
                    return call_user_func($controller, $request);
                }
            }
        }

        return null;
    }
314338
public function getRouteForRequest(Request $request)
    {
        $routes = $this->collection->get($request->getMethod());

        return $this->check($routes, $request);
    }
1216095
public function route(Request $request)
    {
        $request->setUrl($this->api->getPath($request));

        $routeParameters = $this->getRoute($request);
        if ($routeParameters) {
            $class = $routeParameters['class'];
            $function = $routeParameters['function'];
            $routeClass = new $class($this->integration, $this->api, $request);

            return $routeClass->$function();
        } else {
            return $this->api->callAPI($request);
        }
    }
982124
protected function getRouteInformation(Route $route)
    {
        list($controller, $action) = explode("@", $route->getActionName());

        return [
            'host' => $route->domain(),
            'method' => implode('|', $route->methods()),
            'uri' => $route->uri(),
            'name' => $route->getName(),
            'controller' => $controller,
            'action' => $action,
            'resource' => $route->getActionName(),
            'middleware' => Collection::make($this->getMiddleware($route))
        ];
    }
1313475
private function getRoutesFromIndexActions (&$routes, array &$routeActions, &$requestMethod, array &$requestPathParts) {
        foreach ($routeActions as $routeData) {
            $routePath = $routeData[0];
            $routeAction = $routeData[1];
            $routeParameters = [];
            if (strpos($routePath, self::ROUTE_PARAMETER_PREFIX) !== false || strpos($routePath, self::ROUTE_GENERIC_PATH) !== false) {
                $routePathParts = explode(self::ROUTE_PATH_SEPARATOR, trim($routePath, self::ROUTE_PATH_SEPARATOR));;
                for ($i = 0; $i < sizeof($routePathParts); $i++) {
                    $routePathPart = $routePathParts[$i];
                    if ($routePathPart == self::ROUTE_GENERIC_PATH) {
                        $path = array_slice($requestPathParts, $i);
                        $routeParameters[self::ROUTE_PATH_PARAMETER_NAME] = $path;
                        break;
                    }
                    else if ($routePathPart[0] == self::ROUTE_PARAMETER_PREFIX) {
                        $parameterName = substr($routePathPart, 1);
                        $parameterValue = $requestPathParts[$i];
                        $routeParameters[$parameterName] = $parameterValue;
                    }
                }
            }
            if ($routeAction instanceof RouteGenerator) {
                $route = $routeAction->generateRoute($requestMethod, isset($path)?$path : $requestPathParts);
                if ($route) {
                    $routes[] = $route;
                }
            }
            else {
                $routes[] = new Route($routeAction, $routeParameters);
            }
        }
    }
453648
protected function _parse_search($uri, $route = null, $method = null)
	{
		if ($route === null)
		{
			$route = $this;
		}

		if (is_array($route->translation))
		{
			foreach ($route->translation as $r)
			{
				$verb = $r[0];

				$protocol = isset($r[2]) ? ($r[2] ? 'https' : 'http') : false;

				if (($protocol === false or $protocol == \Input::protocol()) and $method == strtoupper($verb))
				{
					$r[1]->search = $route->search;
					$result = $route->_parse_search($uri, $r[1], $method);

					if ($result)
					{
						return $result;
					}
				}
			}

			return false;
		}

		if ($this->case_sensitive)
		{
			$result = preg_match('#^'.$route->search.'$#uD', $uri, $params);
		}
		else
		{
			$result = preg_match('#^'.$route->search.'$#uiD', $uri, $params);
		}

		if ($result === 1)
		{
			return $route->matched($uri, $params);
		}
		else
		{
			return false;
		}
	}
1236759
public function getMatchingRoute($routes, Request $request)
    {
        foreach ($routes as $matchingRoute) {
            if ($matchingRoute->matches($request)) {
                return $matchingRoute;
            }
        }

        return null;
    }
632663
public function getModelFromRoute(Route $route)
    {
        $ret = false;
        $controller = $this->getControllerFromRoute($route);

        if ($controller instanceof RestController) {
            $ret = $controller->getModel();
        }

        return $ret;
    }
1323631
public static function process(\Request $request, $route = true)
	{
		$match = false;

		if ($route)
		{
			foreach (static::$routes as $route)
			{
				if ($match = $route->parse($request))
				{
					break;
				}
			}
		}

		if ( ! $match)
		{
			// Since we didn't find a match, we will create a new route.
			$match = new Route(preg_quote($request->uri->get(), '#'), $request->uri->get());
			$match->parse($request);
		}

		if ($match->callable !== null)
		{
			return $match;
		}

		return static::parse_match($match);
	}
1222050
protected function getRouteInformation($route)
    {
        if (!is_a($route, 'Illuminate\Routing\Route')) {
            return [];
        }
        $uri = head($route->methods()) . ' ' . $route->uri();
        $action = $route->getAction();

        $result = [
           'uri' => $uri ?: '-',
        ];

        $result = array_merge($result, $action);


        if (isset($action['controller']) && strpos($action['controller'], '@') !== false) {
            list($controller, $method) = explode('@', $action['controller']);
            if(class_exists($controller) && method_exists($controller, $method)) {
                $reflector = new \ReflectionMethod($controller, $method);
            }
            unset($result['uses']);
        } elseif (isset($action['uses']) && $action['uses'] instanceof \Closure) {
            $reflector = new \ReflectionFunction($action['uses']);
            $result['uses'] = $result['uses'];
        }

        if (isset($reflector)) {
            $filename = ltrim(str_replace(base_path(), '', $reflector->getFileName()), '/');
            $result['file'] = $filename . ':' . $reflector->getStartLine() . '-' . $reflector->getEndLine();
        }

        return $result;
    }
135690
public function matches(Route $route, Request $request)
    {
        return in_array($request->getMethod(), $route->methods());
    }
750027
private function getOperations(Swagger $api, Route $route): array
    {
        $operations = [];
        $path = $api->getPaths()->get($this->normalizePath($route->getPath()));
        $methods = $route->getMethods() ?: Swagger::$METHODS;
        foreach ($methods as $method) {
            $method = strtolower($method);
            if (!in_array($method, Swagger::$METHODS)) {
                continue;
            }

            $operations[] = $path->getOperation($method);
        }

        return $operations;
    }
755969
private function getParametersFromRequest(Request $request)
    {
        $parameters = $request->query->all();
        if ($routeParameters = $request->attributes->get('_route_params')) {
            $parameters = array_merge($routeParameters, $parameters);
        }

        return $parameters;
    }
1108522
protected function parseRoute($route)
    {
        $parsedRoute = parse_url($route);

        if (isset($parsedRoute['query'])) {
            parse_str($parsedRoute['query'], $parsedRoute['params']);
        } else {
            $parsedRoute['params'] = [];
        }

        $resolvedRoute = new Resolver(new \common_http_Request($route));
        $this->propagate($resolvedRoute);
        $parsedRoute['extension']         = $resolvedRoute->getExtensionId();
        $parsedRoute['controller']        = $resolvedRoute->getControllerShortName();
        $parsedRoute['controller_class']  = $resolvedRoute->getControllerClass();
        $parsedRoute['action']            = $resolvedRoute->getMethodName();

        return $parsedRoute;
    }
1244354
protected function dispatchMethod($request, $route)
    {
        list($path, $var) = $this->parseUrlPath($route);

        $route = str_replace('/', '@', implode('/', $path));
        $method = strpos($route, '@') ? explode('@', $route) : $route;

        return new CallbackDispatch($request, $this, $method, $var);
    }