From 6e68ea19da5e6d9473157fea6b4e60f534f8843a Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 18 Nov 2020 00:30:55 -0600 Subject: [PATCH] easily set a null driver if the passed `$name` is `null` or `'null'`, we'll build up a config with a null driver, so the user does not have to define it in the config file. --- src/Illuminate/Cache/CacheManager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Cache/CacheManager.php b/src/Illuminate/Cache/CacheManager.php index f100d11efad6..352ea6f50cc0 100755 --- a/src/Illuminate/Cache/CacheManager.php +++ b/src/Illuminate/Cache/CacheManager.php @@ -314,7 +314,11 @@ protected function getPrefix(array $config) */ protected function getConfig($name) { - return $this->app['config']["cache.stores.{$name}"]; + if (! is_null($name) && $name !== 'null') { + return $this->app['config']["cache.stores.{$name}"]; + } + + return ['driver' => 'null']; } /**