folderRepository->getModel(); } public function filter( array $data = [], array $relationships = [], array $withCount = [], array $select = ['*'], bool $returnQuery = false ) { if ( $returnQuery || !empty($data['paginate']) ) { return $this->folderRepository ->filter($data, $relationships, $withCount, $select, $returnQuery); } $cacheKey = $this->getCacheKey(md5(json_encode([ 'filter' => compact('data', 'relationships', 'withCount', 'select') ]))); return Cache::remember( $cacheKey, $this->cacheTime, fn() => $this->folderRepository ->filter($data, $relationships, $withCount, $select, $returnQuery) ); } public function findBy(string $key = '', string|int|null $value = '') { $cacheKey = $this->getCacheKey(md5(json_encode([ 'findBy' => [ 'key' => $key, 'value' => $value ] ]))); return Cache::remember($cacheKey, $this->cacheTime, function () use ($key, $value) { return $this->folderRepository->findBy($key, $value); }); } public function findWithRelationships(int $id = 0, array $relationships = [], array $withCount = [], array $withSum = []) { $cacheKey = $this->getCacheKey(md5(json_encode([ 'findWithRelationships' => [ 'id' => $id, 'relationships' => $relationships ] ]))); return Cache::remember($cacheKey, $this->cacheTime, function () use ($id, $relationships, $withCount, $withSum) { return $this->folderRepository->findWithRelationships($id, $relationships, $withCount, $withSum); }); } }