Rework admin panel and other

This commit is contained in:
F4ilji
2025-04-02 18:37:20 +05:00
parent 49072e50c7
commit 5cd6ff11b5
198 changed files with 9715 additions and 6664 deletions
@@ -0,0 +1,42 @@
<?php
namespace App\Services\App\Cache;
use App\Enums\CacheKeys;
use App\Models\Event;
use Illuminate\Support\Facades\Cache;
class EventCacheService extends AbstractCacheService implements CacheInterface
{
private const DEFAULT_TTL = 3600;
public function clearCache($entity): void
{
if ($entity instanceof Event) {
$this->clearAllCacheByModel();
}
}
public function clearAllCacheByModel(): void
{
$this->clearCacheByPrefix(CacheKeys::EVENT_PREFIX->value.'*');
$this->clearAllEventsCache();
}
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);
}
private function clearAllEventsCache(): void
{
Cache::forget(CacheKeys::EVENTS_PREFIX->value.'*');
}
}