private function setResource($url, $route, $controller, $target)
    {
        $url = $url.$route;

        $route = new self($url);

        $closure = $this->getResourceClosure($controller, $target);

        $route->setClosure($closure);
        $route->setMethod('resource');
        $route->setTarget($controller, $target);

        $this->addResource($route);

        $route->add();

        return $route;
    }