Skip to content

Commit 4748002

Browse files
committed
Re-formatted code;
OneSignalClient calls to the API will now return a formatted array instead of a ResponseInterface.
1 parent ceacbb2 commit 4748002

File tree

6 files changed

+307
-291
lines changed

6 files changed

+307
-291
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ ONESIGNAL_USER_AUTH_KEY=
5050
## Usage
5151

5252
There is a function for each of the OneSignal API calls. They are broken down here.
53+
All methods will return an array formatted like this:
54+
```
55+
[
56+
'status' => < HTTP status code of the request >,
57+
'data' => [
58+
< data returned by OneSignal REST API in array format >
59+
],
60+
]
61+
```
5362

5463
**Note:** In all instances where an $app_id is asked for, omitting it will grab the default OneSignal App ID specified in the .env file
5564

config/onesignal.php

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
<?php
22
return [
33
/*
4-
|--------------------------------------------------------------------------
5-
| OneSignal App ID
6-
|--------------------------------------------------------------------------
7-
|
8-
| The OneSignal app to send notifications for by default
9-
|
10-
*/
11-
'onesignal_app_id' => env('ONESIGNAL_APP_ID', ''),
4+
|--------------------------------------------------------------------------
5+
| OneSignal App ID
6+
|--------------------------------------------------------------------------
7+
|
8+
| The OneSignal app to send notifications for by default
9+
|
10+
*/
11+
'onesignal_app_id' => env('ONESIGNAL_APP_ID', ''),
12+
1213
/*
13-
|--------------------------------------------------------------------------
14-
| OneSignal REST API Key
15-
|--------------------------------------------------------------------------
16-
|
17-
| The API key to use the OneSignal API
18-
|
19-
*/
20-
'onesignal_rest_api_key' => env('ONESIGNAL_REST_API_KEY', ''),
14+
|--------------------------------------------------------------------------
15+
| OneSignal REST API Key
16+
|--------------------------------------------------------------------------
17+
|
18+
| The API key to use the OneSignal API
19+
|
20+
*/
21+
'onesignal_rest_api_key' => env('ONESIGNAL_REST_API_KEY', ''),
22+
2123
/*
22-
|--------------------------------------------------------------------------
23-
| OneSignal User Auth Key
24-
|--------------------------------------------------------------------------
25-
|
26-
| A OneSignal User authentication key, used to create apps in OneSignal
27-
|
28-
*/
29-
'onesignal_user_auth_key' => env('ONESIGNAL_USER_AUTH_KEY', ''),
24+
|--------------------------------------------------------------------------
25+
| OneSignal User Auth Key
26+
|--------------------------------------------------------------------------
27+
|
28+
| A OneSignal User authentication key, used to create apps in OneSignal
29+
|
30+
*/
31+
'onesignal_user_auth_key' => env('ONESIGNAL_USER_AUTH_KEY', ''),
3032
];

0 commit comments

Comments
 (0)