discountRepository->getModel(); } public function filter(array $data = [], array $relationships = [], array $withCount = [], array $select = ['*']) { return $this->rememberFilter( compact('data', 'relationships', 'withCount', 'select'), fn() => $this->discountRepository->filter($data, $relationships, $withCount, $select) ); } public function findBy(string $key = '', string $value = '') { if (empty($value) || empty($key)) { return false; } $cacheKey = CacheKey::build($this->getModuleName(), 'find-by', ['key' => $key, 'value' => $value]); return $this->cache->remember($cacheKey, function () use ($key, $value) { return $this->model->where($key, $value)->first(); }); } }