Search the application routes

@param  string $path
@param  string $name
@return mixed
4158
public function getRoute($path = "", $name = "")
    {
        for ($i = 0; $i < count($this->routes); $i++)
        {
            $checkRoute = $this->routes[$i];

            if($checkRoute->getName() === $name || $checkRoute->getPath() === $path)
            {
                return $checkRoute;
            }
            else if($checkRoute->getRegex() != null)
            {
                $regex = $checkRoute->getRegex();

                if(preg_match($regex, $path))
                {
                    preg_match_all('/\/(\w+)/', '/'.ltrim($path, $checkRoute->getStaticPath()), $matches, PREG_SET_ORDER);
                    foreach($matches as $match)
                    {
                        $values[] = $match[1];
                    }
                    $checkRoute->setValues($values);

                    return $checkRoute;
                }
            }
        }

        return false;
    }
1318730
protected function handle(string $path, callable $action, $method, string $name = null): HttpRoute
    {
        if (!is_array($method)) {
            $method = [$method];
        }
        /** @var HttpRoute $route */
        $route = $this->data->createRoute($this->prefix . $path, $action, $name);
        $route->method(...$method);
        return $route;
    }
1032533
public function getRouteByAlias($name)
    {
        $aliases = $this->getAliases();

        return isset($aliases[$name]) ? $aliases[$name] : NULL;
    }
164036
public function getFromPath($name = false, $path = false)
    {
        if ($path && $name) {
            $this->img       = $path . '/' . $name;
            $this->handle    = new Upload($this->img);
            $this->_new_name = $this->s3->sanitizeFilename(uniqid("", true) . $this->handle->file_src_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];
	}
160220
static public function getRoute($name) {
        $route_by_name = isset(self::$_stored_names[$name]) ?
            self::$_stored_names[$name] :
            null;
        
        if (!is_null($route_by_name) && isset(self::$_stored_routes[$route_by_name])) {
            return self::$_stored_routes[$route_by_name];
        }

        return null;
    }
1196251
protected function matchRoute($pathinfo, $name, BaseRoute $route) {
		$compiledRoute = $route->compile();

		// check the static prefix of the URL first. Only use the more expensive preg_match when it matches
		if ('' !== $compiledRoute->getStaticPrefix() && 0 !== strpos($pathinfo, $compiledRoute->getStaticPrefix())) {
			return null;
		}

		if (!preg_match($compiledRoute->getRegex(), $pathinfo, $matches)) {
			return null;
		}

		$hostMatches = array();
		if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) {
			return null;
		}

		// check HTTP method requirement
		if ($req = $route->getRequirement('_method')) {
			// HEAD and GET are equivalent as per RFC
			if ('HEAD' === $method = $this->context->getMethod()) {
				$method = 'GET';
			}

			if (!in_array($method, $req = explode('|', strtoupper($req)))) {
				$this->allow = array_merge($this->allow, $req);

				return null;
			}
		}

		$status = $this->handleRouteRequirements($pathinfo, $name, $route);

		if (self::ROUTE_MATCH === $status[0]) {
			return $status[1];
		}

		if (self::REQUIREMENT_MISMATCH === $status[0]) {
			return null;
		}

		$attrs = $this->getAttributes($route, $name, array_replace($matches, $hostMatches));

		if($route instanceof Route) {
			foreach($route->getMatchCallbacks() as $callback) {
				$ret = call_user_func($callback, $attrs);
				if($ret === false) {
					return null;
				}
				if(is_array($ret)) {
					$attrs = $ret;
				}
			}
		}

		return $attrs;

	}
469113
public function read($name, $path = null) {
        // in cache?
        if(isset($this->cache[$name]))
            return !is_null($path) && isset($this->cache[$name][$path]) ? $this->cache[$name][$path] : $this->cache[$name];

        // no cookie?
        if(!$this->check($name))
            return null;

        return $this->cookies->get($name)->read($path);
    }
56915
protected function getPath($file_name, $path='controller')
    {
        if($path == "controller")
        {
            return './app/Http/Controllers/' . $file_name . '.php';
        }
        elseif($path == "request")
        {
            return './app/Http/Requests/'.$file_name.'.php';
        }
        elseif($path == "observer")
        {
            return './app/Observers/'.$file_name.'.php';
        }
        elseif($path == "policy")
        {
            return './app/Policies/'.$file_name.'.php';
        }
        elseif($path == "factory")
        {
            return './database/factories/'.$file_name.'Factory.php';
        }
        elseif($path == "model")
        {
            return './app/Models/'.$file_name.'.php';
        }
        elseif($path == "model-trait")
        {
            return './app/Models/Traits/'.$file_name.'Operation.php';
        }
        elseif($path == "seed")
        {
            return './database/seeds/'.$file_name.'.php';
        }
        elseif($path == "view-index")
        {
            return './resources/views/'.$file_name.'/index.blade.php';
        }
        elseif($path == "view-edit")
        {
            return './resources/views/'.$file_name.'/edit.blade.php';
        }
        elseif($path == "view-show")
        {
            return './resources/views/'.$file_name.'/show.blade.php';
        }
        elseif($path == "view-create")
        {
            return './resources/views/'.$file_name.'/create.blade.php';
        }
        elseif($path == "localization"){
            return './resources/lang/'.$file_name.'.php';
        }
        elseif($path == "route"){
            return './routes/web.php';
        }
        elseif($path == "route_old"){
            return './app/Http/routes.php';
        }
    }
443182
protected function search( $name, $path, $root ) {

    // check root existance and then try to find the original full named class file
    $path = ltrim( implode( DIRECTORY_SEPARATOR, $path ) . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR );
    if( $this->read( $name, $path, $root ) ) return true;
    else {

      // try to tokenize the class name (based on camel or TitleCase) to support for nested classes
      $tmp = $this->explode( $name );
      foreach( $tmp as $name ) if( $this->read( $name, $path, $root ) ) {
        return true;
      }

      return false;
    }
  }
808103
protected function _mkdir($path, $name) {
		return $this->make($path, $name, 'directory') ? $this->_joinPath($path, $name) : false;
	}
792425
protected function makeFromPath($name, $path)
    {
        if (!$this->get($name)) {

            $params = [
                'name' => $name,
                'path' => rtrim($path, '/') . '/' . $name
            ];

            $module = IOC::resolve('Module', $params);
            $this->add($module->getName(), $module->create());

            return $module;
        }

        return null;
    }
336766
public function findByName($name)
	{
		return $this->routes->first(function ($route) use($name)
		{
			return $route->getName() === $name;
		});
	}
207116
protected function findInPaths($name, $paths)
    {
        foreach ((array) $paths as $path) {
            foreach ($this->getPossibleViewFiles($name) as $file) {
                if ($this->files->exists($viewPath = $path.'/'.$file)) {
                    return $viewPath;
                }
            }
        }

        throw new InvalidArgumentException("View [{$name}] not found.");
    }
663658
protected function findInPaths($name, $paths)
    {
        foreach ((array)$paths as $path) {
            $file = $this->getViewFilename($name);
            if (file_exists($viewPath = $path . '/' . $file)) {
                return $viewPath;
            }
        }
        throw new InvalidArgumentException(
            'View [' . $name . '] not found in paths [' . implode(', ', $paths) . '].'
        );
    }
299465
public function name($name){
        return isset($this->routes[$name]) ? $this->routes[$name] : false;
    }
1041632
public function get($path)
    {
        if (isset($this->allRoutes[$path])) {
            return $this->allRoutes[$path];
        }

        throw new RoutingException("Route [{$path}] does not exist.");
    }