public function reverse($resource, array $params = [])
    {
        // search in all routes
        if($key = array_search($resource, $this->routes)) {
            $route = $this->routes[$key];
            $route->params = $params;
            return $route;
        }
    }