Determine if any of the provided routes are active.

@param  mixed  $routes
@return bool
774674
public function isActive($routes)
    {
        $routes = is_array($routes) ? $routes : func_get_args();

        list($routes, $ignoredRoutes) = $this->parseIgnoredRoutes($routes);

        if ($this->isPath($routes) || $this->isFullPath($routes) || $this->isRoute($routes)) {
            if (count($ignoredRoutes) && ($this->isPath($ignoredRoutes) || $this->isFullPath($routes) || $this->isRoute($ignoredRoutes))) {
                return false;
            }

            return true;
        }

        return false;
    }
99445
protected function isNotSameRouteHost(Route $route): bool
    {
        if ($this->host === null && $route->getHost() === null) {
            return false;
        }

        if ($this->host === null && $route->getHost() !== null) {
            return true;
        }

        return !$route->isSameHost($this->host, $this->hostConstraints);
    }
1117278
private function sortMethods(array $routes)
    {
        uasort($routes, function (Route $a, Route $b) {
            if ($a->getMethods() === $b->getMethods()) {
                return 0;
            }

            return ($a->getMethods() < $b->getMethods()) ? -1 : 1;
        });

        return $routes;
    }
433932
private static function runRouteMiddleware($route)
    {
        $routeMiddleware = Filter::$routeMiddleware;

        if (!is_null($route->getMiddleware())) {
            // if ($route->getMiddleware()['type'] == 'route' && ! is_null($route->getMiddleware()['middlewares'])) {
            foreach ($route->getMiddleware() as $middleware) {
                //Check if the routes middlewares are in filter class
                exception_if(!array_has($routeMiddleware, $middleware), RouteMiddlewareNotFoundException::class, $middleware);

                $middleware = instance($routeMiddleware[$middleware]);

                $middleware->handle(new Request());
            }
        }

        return true;
    }
820837
public function isPath($routes)
    {
        $routes = is_array($routes) ? $routes : func_get_args();

        return call_user_func_array([$this->request, 'is'], $routes);
    }
1230594
public function isActive()
    {
        switch ($this->type) {

            case MenuPresenceType::GROUP:
                return false;

            case MenuPresenceType::ACTION:
                // Activity is based on named route match, unless specific match is defined
                return false;

            case MenuPresenceType::LINK:
                // Activity is based on URL match, unless specific match is defined
                return false;

            // Default omitted on purpose
        }

        return false;
    }
898983
public function checkRouteBoolean($route)
    {
        if (is_array($route)) {
            $result = call_user_func_array(array($this,'routeIsDeeply'), $route);
        } else {
            $result = $this->routeIsDeeply($route);   
        }
        return $result;
    }
625740
public function checkRoutePattern($patterns)
    {
        if (!$this->route) {
            return false;
        }

        $routeName = $this->route->getName();

        if ($routeName == null) {
            return in_array(null, $patterns);
        }

        foreach ((array)$patterns as $p) {
            if (str_is($p, $routeName)) {
                return true;
            }
        }

        return false;
    }
894690
protected function check(array $routes, $request, $includingMethod = true)
    {
        return Arr::first($routes, function ($key, $route) use ($request, $includingMethod)
        {
            return $route->matches($request, $includingMethod);
        });
    }
157158
public static function checkRoute($userId, $route)
    {
        $routes = static::getRoutesByUser($userId);
        $route = '/' . ltrim($route, '/');
        if (isset($routes[$route])) {
            return true;
        }
        while (($pos = strrpos($route, '/')) > 0) {
            $route = substr($route, 0, $pos);
            if (isset($routes[$route . '/*'])) {
                return true;
            }
        }
        return isset($routes['/*']);
    }
637052
public function is()
	{
		$this->routes = array(); 

		foreach(func_get_args() as $param)
		{
			if(!is_array($param))
			{
				$this->routes[] = $param;
				continue;
			}

			foreach ($param as $p) 
			{
				$this->routes[] = $p;
			}
		}

		$this->request = Request::path();

		$this->parseRoutes();

		foreach($this->routes as $route)
		{
			if(!Request::is($route))
			{
				continue;
			}

			foreach($this->bad_routes as $bad_route)
			{
				if(str_is($bad_route, $this->request))
				{
					return false;
				}
			}

			return true;		
		}

		return false;
	}
1230709
public function activateOnRoute(string $route)
    {
        $this->activeWhen = function () use ($route) {
            return str_contains(Route::currentRouteName(), $route);
        };

        return $this;
    }
1140815
public function route($routes, $class = null)
    {
        $routes = (array) $routes;

        if ($this->isRoute($routes)) {
            return $this->getActiveClass($class);
        }
    }
119188
private function _getRouteMatch($path,$routes)
	{
		foreach ($routes as $route)
		{
			if ($match = $route->getMatch($path, $this->metadata($route->getName())))
				return $match;
		}
		return false;
	}
571767
public function hasRoute(string $route): bool
    {
        foreach ($this->getActions() as $action) {
            if ($action->getRouteName() === $route) {
                return true;
            }
        }

        return false;
    }
468833
public function addRoutes(array $routes)
    {
        foreach ($routes as $route => $endpoint) {
            // Add route as key. Use rtrim to remove any existing trailing slash, and then
            // add a new trailing slash
            $route = ($route !== '/') ? rtrim($route, '/') : '/';
            $this->routes[$route] = $endpoint;
        }
    }
1124515
public static function all( $routes ) 
	{

		/* Call all functions that are to be executed before routing */
		foreach( self::$beforeFuncs as $beforeFunc ) {
			if( $beforeFunc[1] ) {
				call_user_func_array( $beforeFunc[0] , $beforeFunc[1] );
			} else {
				call_user_func( $beforeFunc[0] );
			}
		}

		self::$routes = $routes;
		$method = strtolower($_SERVER['REQUEST_METHOD']);
		$path = '/';
		$handler = null;
		$matched = array();
		if ( !empty ( $_SERVER['PATH_INFO'] ) ) {
			$path = $_SERVER['PATH_INFO'];
		} else if ( !empty ( $_SERVER['REQUEST_URI'] ) ) {
            $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
		}

		if ( isset($routes[$path] ) ) {
			if( is_array( $routes[$path] ) ) {
				$handler = $routes[$path][0];
			} else {
				$handler = $routes[$path];
			}
		} else if ( $routes ) {
			
			$regex = array(
				'/{i}/',
				'/{s}/',
				'/{a}/'
				);

			$replacements = array(
				'([\d]+)'	,
				'([a-zA-Z]+)',
				'([\w-]+)'
				);

			foreach ( $routes as $routePath => $routeDesc ){
				$routePath = preg_replace( $regex, $replacements, $routePath );
				if( preg_match( '#^/?' . $routePath . '/?$#', $path, $matches ) ){
					if( is_array( $routeDesc ) ) {
						$handler = $routeDesc[0];
						if( isset( $routeDesc[2] )) {
							$middleware = $routeDesc[2];
						}
					}
					else 
						$handler = $routeDesc;
					$matched = $matches;
					break;
				}
			}
		}
		unset( $matched[0] );

		if( isset($middleware) ){
			$newMatched = self::callFunction( $middleware, $matched, $method );
			/* If new wildcard param are there pass them to main handler */
			if( $newMatched ) { 
				self::callFunction( $handler, $newMatched, $method );
			} else {
				self::callFunction( $handler, $matched, $method );
			}
		} else {
			self::callFunction( $handler, $matched, $method );
		}

		/* Call all the function that are to be executed after routing */
		foreach( self::$afterFuncs as $afterFunc )
			if( $afterFunc[1] ) {
				call_user_func_array( $afterFunc[0] , $afterFunc[1] );
			} else {
				call_user_func( $afterFunc[0] );
			}
	}