diff --git a/src/PubSub/Drivers/RedisClient.php b/src/PubSub/Drivers/RedisClient.php index e3faa75..672ce84 100644 --- a/src/PubSub/Drivers/RedisClient.php +++ b/src/PubSub/Drivers/RedisClient.php @@ -257,7 +257,7 @@ class RedisClient implements ReplicationInterface */ protected function getConnectionUri() { - $name = config('websockets.replication.redis.connection') ?? 'default'; + $name = config('websockets.replication.redis.connection') ?: 'default'; $config = config('database.redis')[$name]; $host = $config['host']; diff --git a/src/WebSocketsServiceProvider.php b/src/WebSocketsServiceProvider.php index 4a031e7..cbed590 100644 --- a/src/WebSocketsServiceProvider.php +++ b/src/WebSocketsServiceProvider.php @@ -57,13 +57,13 @@ class WebSocketsServiceProvider extends ServiceProvider protected function configurePubSub() { - if (config('websockets.replication.driver') === 'local') { + if (config('websockets.replication.driver', 'local') === 'local') { $this->app->singleton(ReplicationInterface::class, function () { return new LocalClient; }); } - if (config('websockets.replication.driver') === 'redis') { + if (config('websockets.replication.driver', 'local') === 'redis') { $this->app->singleton(ReplicationInterface::class, function () { return (new RedisClient)->boot($this->loop ?? LoopFactory::create()); });