From d167965504424c1260b482f7b045784117ecd110 Mon Sep 17 00:00:00 2001 From: rennokki Date: Sun, 14 Jun 2020 20:35:08 +0300 Subject: [PATCH] Reordered the $class variable --- src/FlushQueryCacheObserver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FlushQueryCacheObserver.php b/src/FlushQueryCacheObserver.php index a5a4967..cee04a0 100644 --- a/src/FlushQueryCacheObserver.php +++ b/src/FlushQueryCacheObserver.php @@ -71,12 +71,12 @@ public function restored(Model $model) */ protected function invalidateCache(Model $model): void { + $class = get_class($model); + if (! $model->getCacheTagsToInvalidateOnUpdate()) { throw new Exception('Automatic invalidation for '.$class.' works only if at least one tag to be invalidated is specified.'); } - $class = get_class($model); - $class::flushQueryCache( $model->getCacheTagsToInvalidateOnUpdate() );