clearAllCacheByModel(); } } public function clearAllCacheByModel(): void { $this->clearCacheByPrefix(self::CACHE_PREFIX.'*'); $this->clearAllDivisionsCache(); } public function getCachedData(string $key) { return Cache::get($key); } public function cacheData(string $key, $data, int $ttl = null): void { Cache::put($key, $data, $ttl ?? self::DEFAULT_TTL); } public function getCacheKey(int $id): string { return self::CACHE_PREFIX . $id; } public function getAllCacheKey(): string { return self::ALL_CACHE_KEY; } private function forgetDivisionCache(int $id): void { Cache::forget($this->getCacheKey($id)); } private function clearAllDivisionsCache(): void { Cache::forget(self::ALL_CACHE_KEY); } }