public function route(string $route, array $params = [], int $code = 302, string $method = 'auto')
	{
		$routes = Services::routes(true);

		$route = $routes->reverseRoute($route, ...$params);

		if (! $route)
		{
			throw HTTPException::forInvalidRedirectRoute($route);
		}

		return $this->redirect(base_url($route), $method, $code);
	}
public function route(string $route, array $params = [], int $code = 302, string $method = 'auto')
	{
		$routes = Services::routes(true);

		$route = $routes->reverseRoute($route, ...$params);

		if (! $route)
		{
			throw HTTPException::forInvalidRedirectRoute($route);
		}

		return $this->redirect(base_url($route), $method, $code);
	}
public function route ( string $ route , array $ params = [ ] , int $ code = 302 , string $ method = 'auto' ) { $ routes = Services :: routes ( true ) ; $ route = $ routes -> reverseRoute ( $ route , ... $ params ) ; if ( ! $ route ) { throw HTTPException :: forInvalidRedirectRoute ( $ route ) ; } return $ this -> redirect ( base_url ( $ route ) , $ method , $ code ) ; }
Sets the URI to redirect to but as a reverse-routed or named route
instead of a raw URI.

@param string       $route
@param array        $params
@param integer|null $code
@param string       $method

@return $this
Sets the URI to redirect to but as a reverse - routed or named route instead of a raw URI .