clearAllCacheByModel(); } } public function clearAllCacheByModel(): void { $this->clearCacheByPrefix(CacheKeys::DEPARTMENT_PREFIX->value.'*'); $this->clearCacheByPrefix(CacheKeys::DEPARTMENTS_PREFIX->value.'*'); $this->clearCacheByPrefix(CacheKeys::USER_PREFIX->value.'*'); } 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); } }