@@ -8,7 +8,7 @@ Installation
8
8
9
9
Update your ` composer.json ` file to include this package as a dependency
10
10
11
- Laravel 5
11
+ Laravel 5 & Lumen
12
12
13
13
``` json
14
14
"davibennun/laravel-push-notification" : " dev-laravel5"
@@ -36,7 +36,7 @@ Alias the PushNotification facade by adding it to the aliases array in the `app/
36
36
37
37
# Configuration
38
38
39
- Copy the config file into your project by running
39
+ Copy the config file into your project by running: (Lumen users skip this)
40
40
41
41
Laravel 5
42
42
``` php
@@ -84,6 +84,23 @@ PushNotification::app('appNameIOS')
84
84
85
85
```
86
86
Where app argument ` appNameIOS ` refers to defined service in config file.
87
+
88
+ ###Dynamic configuration and Lumen users
89
+ You can set the app config array directly: (keep in mind the array schema)
90
+ ``` php
91
+ //iOS app
92
+ PushNotification::app(['environment' => 'development',
93
+ 'certificate' => '/path/to/certificate.pem',
94
+ 'passPhrase' => 'password',
95
+ 'service' => 'apns']);
96
+ //Android app
97
+ PushNotification::app(['environment' => 'production',
98
+ 'apiKey' => 'yourAPIKey',
99
+ 'service' => 'gcm']);
100
+
101
+ ```
102
+
103
+
87
104
To multiple devices and optioned message:
88
105
``` php
89
106
$devices = PushNotification::DeviceCollection(array(
@@ -108,7 +125,7 @@ $message = PushNotification::Message('Message Text',array(
108
125
))
109
126
));
110
127
111
- collection = PushNotification::app('appNameIOS')
128
+ $ collection = PushNotification::app('appNameIOS')
112
129
->to($devices)
113
130
->send($message);
114
131
0 commit comments