Skip to content

Commit

Permalink
add options in config for pusher connection
Browse files Browse the repository at this point in the history
  • Loading branch information
nahid committed Apr 22, 2017
1 parent e2bbe26 commit e3d7609
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 4 additions & 0 deletions config/talk.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
'app_id' => '',
'app_key' => '',
'app_secret' => '',
'options' => [
'cluster' => 'ap1',
'encrypted' => true
]
],
],
];
11 changes: 2 additions & 9 deletions src/Live/Broadcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ class Broadcast
* */
protected $config;

/*
* Set default options for pusher credentials
*
* @var array
* */
protected $options = [
'encrypted' => false,
];

/*
* Pusher instance
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e3d7609

Please sign in to comment.