From e3d7609bd7daab19374a790cecb0a1054fc68c54 Mon Sep 17 00:00:00 2001 From: Nahid Bin Azhar Date: Sat, 22 Apr 2017 11:26:50 +0600 Subject: [PATCH] add options in config for pusher connection --- config/talk.php | 4 ++++ src/Live/Broadcast.php | 11 ++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/config/talk.php b/config/talk.php index 913d033..249dbe0 100644 --- a/config/talk.php +++ b/config/talk.php @@ -11,6 +11,10 @@ 'app_id' => '', 'app_key' => '', 'app_secret' => '', + 'options' => [ + 'cluster' => 'ap1', + 'encrypted' => true + ] ], ], ]; diff --git a/src/Live/Broadcast.php b/src/Live/Broadcast.php index 4eb91fa..3bbd879 100644 --- a/src/Live/Broadcast.php +++ b/src/Live/Broadcast.php @@ -25,14 +25,6 @@ class Broadcast * */ protected $config; - /* - * Set default options for pusher credentials - * - * @var array - * */ - protected $options = [ - 'encrypted' => false, - ]; /* * Pusher instance @@ -65,8 +57,9 @@ protected function connectPusher($options = []) $appId = $this->getConfig('broadcast.pusher.app_id'); $appKey = $this->getConfig('broadcast.pusher.app_key'); $appSecret = $this->getConfig('broadcast.pusher.app_secret'); + $appOptions = $this->getConfig('broadcast.pusher.options'); - $newOptions = array_merge($this->options, $options); + $newOptions = array_merge($appOptions, $options); $pusher = new Pusher($appKey, $appSecret, $appId, $newOptions); return $pusher;