invoiceRepository->getModel(); } 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->invoiceRepository->filter($data, $relationships, $withCount, $select); }); } public function get_billing_year(int $year = 0) { $cacheKey = $this->getCacheKey(md5(json_encode([ 'get_billing_year' => [ 'year' => $year ] ]))); return Cache::remember($cacheKey, $this->cacheTime, function () use ($year) { return $this->invoiceRepository->get_billing_year($year); }); } public function get_billing_month(int $month = 0) { $cacheKey = $this->getCacheKey(md5(json_encode([ 'get_billing_month' => [ 'month' => $month ] ]))); return Cache::remember($cacheKey, $this->cacheTime, function () use ($month) { return $this->invoiceRepository->get_billing_month($month); }); } public function get_billing_day(int|string $day = '') { $cacheKey = $this->getCacheKey(md5(json_encode([ 'get_billing_day' => [ 'day' => $day ] ]))); return Cache::remember($cacheKey, $this->cacheTime, function () use ($day) { return $this->invoiceRepository->get_billing_day($day); }); } public function findWithRelationships(int $id = 0, array $relationships = [],array $withCount = [], array $withSum = []) { $cacheKey = $this->getCacheKey(md5(json_encode([ 'findWithRelationships' => [ 'id' => $id, 'relationships' => $relationships, 'withCount' => $withCount, 'withSum' => $withSum ] ]))); return Cache::remember($cacheKey, $this->cacheTime, function () use ($id, $relationships,$withCount,$withSum) { return $this->invoiceRepository->findWithRelationships($id, $relationships,$withCount,$withSum); }); } }