Skip to content

Commit 83f20f0

Browse files
authored
Merge pull request #35 from shalvah/patch-2
Switch config file to use env variables by default
2 parents 7fd8191 + 896dccd commit 83f20f0

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

config/pusher.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@
4040
'connections' => [
4141

4242
'main' => [
43-
'auth_key' => 'your-auth-key',
44-
'secret' => 'your-secret',
45-
'app_id' => 'your-app-id',
46-
'options' => [],
43+
'auth_key' => env('PUSHER_APP_KEY'),
44+
'secret' => env('PUSHER_APP_SECRET'),
45+
'app_id' => env('PUSHER_APP_ID'),
46+
'options' => [
47+
'cluster' => env('PUSHER_APP_CLUSTER'),
48+
],
4749
'host' => null,
4850
'port' => null,
4951
'timeout' => null,

src/PusherFactory.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ protected function getConfig(array $config): array
6363
throw new InvalidArgumentException("Missing configuration key [$key].");
6464
}
6565
}
66+
67+
foreach ($config['options'] as $option => $value) {
68+
if (is_null($value)) {
69+
unset($config['options'][$option]);
70+
}
71+
}
6672

6773
return array_only($config, $keys);
6874
}

0 commit comments

Comments
 (0)