diff --git a/src/Cache/Cache.php b/src/Cache/Cache.php index 70fcfdcf8ad..9154d96418d 100644 --- a/src/Cache/Cache.php +++ b/src/Cache/Cache.php @@ -445,6 +445,25 @@ public static function clear($check = false, $config = 'default') $engine = static::engine($config); return $engine->clear($check); } + + /** + * Delete all keys from the cache from all configurations. + * + * @param bool $check if true will check expiration, otherwise delete all + * @return bool True if the cache of all configurations was successfully cleared, false otherwise + */ + public static function clearAll($check = false) + { + $success = true; + + foreach (self::configured() as $config) { + if (!self::clear($check, $config)) { + $success = false; + } + } + + return $success; + } /** * Delete all keys from the cache belonging to the same group.