Skip to content

Commit

Permalink
easily set a null driver (#35262)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
browner12 authored Nov 18, 2020
1 parent a7e7852 commit 3f6bb3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}

/**
Expand Down

0 comments on commit 3f6bb3b

Please sign in to comment.