public function generate(string $name, array $attributes = [], ?string $prefix = null): string
    {
        $prefix = $prefix ?? $this->prefix ?? "";

        $route = $this->routes->oneNamed($name);

        if ($route === null) {
            throw RouteNotFound::named($name);
        }

        $path = $route->getPath();

        $uri = $this->uriFactory->create($path, $attributes);

        return $prefix . $uri;
    }