Skip to content

Commit

Permalink
Allow additional Redis config in config/database.php (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
kchoppin authored May 16, 2022
1 parent 05ca29d commit 011b542
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ConfiguresRedis.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Laravel\Vapor;

use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Config;

trait ConfiguresRedis
Expand All @@ -17,7 +18,7 @@ protected function ensureRedisIsConfigured()
return;
}

Config::set('database.redis', [
Config::set('database.redis', array_merge(Arr::except(Config::get('database.redis', []), ['default', 'cache']), [
'client' => $_ENV['REDIS_CLIENT'] ?? 'phpredis',
'options' => array_merge(Config::get('database.redis.options', []), [
'cluster' => $_ENV['REDIS_CLUSTER'] ?? 'redis',
Expand All @@ -40,6 +41,6 @@ protected function ensureRedisIsConfigured()
],
],
]),
]);
]));
}
}

0 comments on commit 011b542

Please sign in to comment.