addonRepository->getModel(); } public function filter( array $data = [], array $relationships = [], array $withCount = [], array $select = ['*'], bool $returnQuery = false ) { if ( $returnQuery || !empty($data['paginate']) ) { return $this->addonRepository ->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->addonRepository ->filter($data, $relationships, $withCount, $select, $returnQuery) ); } }