groupRepository->getModel(); } public function getProduct(int $group_id = 0, int $type_id = 0) { $cacheKey = $this->getCacheKey(md5(json_encode([ 'type_id' => $type_id, 'group_id' => $group_id ]))); return Cache::remember($cacheKey, $this->cacheTime, function () use ($type_id, $group_id) { return $this->groupRepository->getProduct($group_id, $type_id); }); } public function filter(array $data = [], array $relationships = [], array $withCount = [], array $select = ['*']) { $cacheKey = $this->getCacheKey(md5(json_encode([ 'filterItem' => [ 'data' => $data, 'relationships' => $relationships, 'select' => $select, 'withCount' => $withCount ] ]))); return Cache::remember($cacheKey, $this->cacheTime, function () use ($data, $relationships, $select, $withCount) { return $this->groupRepository->filter($data, $relationships, $withCount, $select); }); } public function findBySlugWithProduct(string $slug) { return $this->model->where('slug', $slug)->with(['hostings', 'vps'])->first(); } }