Skip to content

Commit

Permalink
Merge pull request #140 from stephenjude/master
Browse files Browse the repository at this point in the history
Allow use of dotenv variables in the package config file
  • Loading branch information
berkayk authored Jan 28, 2021
2 parents 5f84434 + 18cc411 commit 11a3015
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Then, register class alias by adding an entry in aliases section
Finally, from the command line again, run

```
php artisan vendor:publish --tag=config
php artisan vendor:publish --provider="Berkayk\OneSignal\OneSignalServiceProvider" --tag="config"
```

to publish the default configuration file.
Expand All @@ -61,8 +61,12 @@ your OneSignal authorization keys.

## Configuration

You need to fill in `onesignal.php` file that is found in your applications `config` directory.
`app_id` is your *OneSignal App ID* and `rest_api_key` is your *REST API Key*.
You need to fill in your OneSignal *App ID* and *REST API Key* inside your
.env file like this:
```
ONESIGNAL_APP_ID=xxxxxxxxxxxxxxxxxxxx
ONESIGNAL_REST_API_KEY=xxxxxxxxxxxxxxxxxx
```

## Usage

Expand Down
8 changes: 4 additions & 4 deletions config/onesignal.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
|
|
*/
'app_id' => 'YOUR-APP-ID-HERE',
'app_id' => env('ONESIGNAL_APP_ID'),

/*
|--------------------------------------------------------------------------
Expand All @@ -18,6 +18,6 @@
|
|
*/
'rest_api_key' => 'YOUR-REST-API-KEY-HERE',
'user_auth_key' => 'YOUR-USER-AUTH-KEY'
);
'rest_api_key' => env('ONESIGNAL_REST_API_KEY'),
'user_auth_key' => env('USER_AUTH_KEY')
);

0 comments on commit 11a3015

Please sign in to comment.