Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,29 @@ You can install this package via composer:
``` bash
composer require enniel/laravel-fcm-notification-channel:1.*
```
Register the provider directly in your app configuration file `config/app.php`:

If you aren't using Laravel 5.5 register the provider directly in your app configuration file `config/app.php`:

``` php
'providers' => [
// ...

NotificationChannels\FCM\ServiceProvider::class
NotificationChannels\FCM\ServiceProvider::class,
LaravelFCM\FCMServiceProvider::class,
]
```

In your `.env` file, add the server key and the secret key for the Firebase Cloud Messaging:

```php
FCM_SERVER_KEY=my_secret_server_key
FCM_SENDER_ID=my_secret_sender_id
```

To get these keys, you must create a new application on the [firebase cloud messaging console](https://console.firebase.google.com/).

After the creation of your application on Firebase, you can find keys in `project settings -> cloud messaging`.

## Usage

Now you can use the channel in your `via()` method inside the notification:
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
},
"laravel": {
"providers": [
"NotificationChannels\\FCM\\ServiceProvider"
]
}
},
"minimum-stability": "dev",
Expand Down