From 0c74f04601fea3e2751ea61c94617679fd8cace3 Mon Sep 17 00:00:00 2001 From: Muhammad Huzaifa Date: Thu, 4 Jan 2024 03:07:31 +0500 Subject: [PATCH] Won't show exception if cache driver is not supported Instead of throwing an exception, the configuration file explicitly mentioned the unsupported drivers, the package should gracefully handle it instead of throwing an exception. --- src/Cache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cache.php b/src/Cache.php index 7b9381a..12b4320 100644 --- a/src/Cache.php +++ b/src/Cache.php @@ -29,7 +29,7 @@ class Cache */ public function __construct(CacheManager $cache, $tags, $expires = 30) { - $this->cache = $tags ? $cache->tags($tags) : $cache; + $this->cache = $tags && ! in_array($cache->getDefaultDriver(), ['file', 'database']) ? $cache->tags($tags) : $cache; $this->expires = $expires; } @@ -71,4 +71,4 @@ public function flush() { return $this->cache->flush(); } -} \ No newline at end of file +}