Filter by prefix name

@param string $name
@return \PHPLegends\Routes\Collection
772169
public function filterByPrefixName($name)
    {
        return $this->filter(function (Route $route) use ($name)
        {
            return strpos($route->getName(), $name) === 0;
        });
    }
327343
public function setName($name)
    {
        $index_prefix = Config::get('larasearch.elasticsearch.index_prefix', '');
        if ($index_prefix && !Str::startsWith($name, $index_prefix)) $name = $index_prefix . $name;

        $this->name = $name;

        return $this;
    }
1306104
public function getNamedRoute(string $name): Route
    {
        foreach ($this->getRoutes() as $route) {
            if ($route->getName() === $name) {
                return $route;
            }
        }

        throw new InvalidArgumentException('Named route does not exist for name: ' . $name);
    }
221081
protected function prefixModule($name)
	{
		if (strpos($name, ':') === false)
		{
			$name = $this->getModuleName() .':'. $name;
		}
		return $name;
	}
824042
public function getRouteDefinition(string $name):array
    {
        $this->prepare();

        if (!isset($this->routes[$name]) || !is_array($this->routes[$name])) {
            throw new \RuntimeException(sprintf(
                'Route "%s" does not exist or not array.',
                $name
            ));
        }

        return $this->routes[$name];
    }
856547
public function removeFilterByName($name)
    {
        return $this->removeFilterByFunction(
            function($key, $query) use ($name) {
                $key = $query->getKey();
                return $key == $name;
            }
        );
    }
184907
private function filterParams($name)
    {
        if (empty($this->options[$name])) {
            return;
        }

        if (is_array($this->options['params_filters'])) {
            foreach ($this->options['params_filters'] as $pattern) {
                foreach ($this->options[$name] as $key => $value) {

                    if (preg_match($pattern, $key)) {
                        $this->options[$name][$key] = '[FILTERED]';
                    }
                }
            }
        }
    }
698020
protected function getRouteName($name)
    {
        $name = Str::replaceFirst($this->getDefaultNamespace(trim($this->rootNamespace(), '\\')).'\\', '', $name);
        $name = 'Api\\'.Str::replaceLast('Controller', '', $name);
        $names = explode('\\', $name);
        foreach ($names as $key => $value) {
            $names[$key] = snake_case($value);
        }
        if ($this->option('parent') && count($names) >= 2) {
            $model = str_plural(array_pop($names));
            $parent = str_plural(array_pop($names));
            array_push($names, $parent, $model);
        } elseif (($this->option('model') || $this->option('resource')) && count($names) >= 1) {
            $model = str_plural(array_pop($names));
            array_push($names, $model);
        }
        $name = implode('.', $names);

        return str_replace('\\', '.', $name);
    }
797004
function prefix( $name = '' ) {
		return is_object( $this->parent ) ? $this->parent->prefix( $name ) : $name;
	}
739166
public function getFilter($name)
    {
        $filter = null;
        if(isset($this->_filters[$name])) {
            $filter = $this->_filters[$name];
        }

        return $filter;
    }
1165350
public function getRoute($name, array $params = null)
    {
        if (!isset($this->routes[ $name ])) {
            throw new RouteNotFoundException('The path does not exist.');
        }

        $route = $this->routes[ $name ];

        $prefix = !$this->isRewrite()
            ? '?'
            : '';

        $path = $route[ 'path' ];

        if (!empty($params) && isset($route[ 'with' ])) {
            foreach ($route[ 'with' ] as $key => $value) {
                if (!preg_match('/^' . $value . '$/', $params[ $key ])) {
                    throw new RouteArgumentException($params[ $key ], $value, $path);
                }
                $path = str_replace($key, $params[ $key ], $path);
            }
        }

        return $this->basePath . $prefix . $path;
    }
569044
public function get($name) {
		return isset($_SESSION[$this->prefix . $name]) ? $_SESSION[$this->prefix . $name] : false;

	}
1067765
public function prefixApiRoute($name)
    {
        $prefix = $this->apiConfig('route.name-prefix');

        return starts_with($name, $prefix) ? $name : $prefix . $name;
    }
1282839
public function getNamedRoute(string $name): Route
	{
		if(!isset($this->namedRoutes[$name]))
		{
			throw new RuntimeException(vsprintf('No route named [ %s ] has been defined.', [$name]));
		}

		return $this->namedRoutes[$name];
	}
623761
public function setPrettyName($name, $prefix = true)
    {
        if (empty($name)) {
            return $this;
        }

        $this->prettyName = $this->urlize($name);
        $this->prettyPrefix = $prefix;

        return $this;
    }
599818
private static function filterName( $name ) {
		if ( function_exists( 'apply_filters' ) ) {
			return (string) apply_filters( strtolower( self::HOST_NAME_KEY ), $name );
		}

		return $name;
	}
45126
private function getFilter($name)
    {
        if (!$this->hasFilter($name)) {
            throw new FilterNotFoundException($name);
        }

        return $this->filters[$name];
    }