<?php

namespace App\Observers;

use Illuminate\Support\Facades\Cache;
use App\Constants\CacheKey;

class HomeCacheObserver
{
    public function created()
    {
        Cache::forget(CacheKey::HOME_PAGE);
    }

    public function updated()
    {
        Cache::forget(CacheKey::HOME_PAGE);
    }

    public function deleted()
    {
        Cache::forget(CacheKey::HOME_PAGE);
    }

    private function clearCaches()
    {
        Cache::forget(CacheKey::HOME_PAGE);
        Cache::forget('shared_data');
    }
}
