diff --git a/app/Models/Gallery.php b/app/Models/Gallery.php index 835a6f2..855a3ff 100644 --- a/app/Models/Gallery.php +++ b/app/Models/Gallery.php @@ -35,10 +35,7 @@ class Gallery extends Model parent::boot(); $clearCache = function ($gallery) { - $cacheKeys = [ - "gallery:{$gallery->id}:media", - ]; - Cache::forget($cacheKeys); + Cache::forget("gallery:{$gallery->id}:media"); }; static::saving($clearCache); diff --git a/app/Models/Media.php b/app/Models/Media.php index 6d73956..597a20e 100644 --- a/app/Models/Media.php +++ b/app/Models/Media.php @@ -110,10 +110,7 @@ class Media extends Model parent::boot(); $clearCache = function ($media) { - $cacheKeys = [ - "media:{$media->id}", - ]; - Cache::forget($cacheKeys); + Cache::forget("media:{$media->id}"); }; static::updating(function ($media) use ($clearCache) { diff --git a/app/Models/User.php b/app/Models/User.php index 557a3b2..ad05535 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -90,11 +90,10 @@ class User extends Authenticatable implements Auditable parent::boot(); $clearCache = function ($user) { - $cacheKeys = [ + Cache::forget( "user:{$user->id}", - "user:{$user->id}:permissions", - ]; - Cache::forget($cacheKeys); + "user:{$user->id}:permissions" + ); }; static::saving($clearCache);