public function getRepository($class, $id, $key, $vars = [])
    {
        $classKey = str_replace('\\', '', $class);
        $cacheKey = "repositories.{$classKey}.{$id}.{$key}";

        if ($object = $this->cache->get($cacheKey)) {
            return $object;
        }

        $repository = new $class(
            $this->http,
            $this->cache,
            $this->factory,
            $vars
        );

        $this->cache->set($cacheKey, $repository);

        return $repository;
    }