1
- # Pusher Beams push notifications channel for Laravel 5.5+, 6.x, 7.x & 8 .x
1
+ # Pusher Beams push notifications channel for Laravel 8.x & 9 .x
2
2
3
3
[ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/laravel-notification-channels/pusher-push-notifications.svg?style=flat-square )] ( https://packagist.org/packages/laravel-notification-channels/pusher-push-notifications )
4
4
[ ![ Software License] ( https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square )] ( LICENSE.md )
@@ -17,7 +17,7 @@ Also please note that prior to version 2.0, this package integrated with Pusher'
17
17
18
18
## Contents
19
19
20
- - [ Pusher Beams push notifications channel for Laravel 5.5+, 6.x, 7.x & 8 .x] ( #pusher-beams-push-notifications-channel-for-laravel-55-6x-7x--8x )
20
+ - [ Pusher Beams push notifications channel for Laravel 8.x & 9 .x] ( #pusher-beams-push-notifications-channel-for-laravel-55-6x-7x--8x )
21
21
- [ Contents] ( #contents )
22
22
- [ Installation] ( #installation )
23
23
- [ Setting up your Pusher account] ( #setting-up-your-pusher-account )
@@ -38,7 +38,7 @@ Also please note that prior to version 2.0, this package integrated with Pusher'
38
38
39
39
You can install the package via composer:
40
40
41
- ``` bash
41
+ ``` bash
42
42
composer require laravel-notification-channels/pusher-push-notifications
43
43
```
44
44
@@ -51,7 +51,7 @@ Before using this package you should set up a Pusher Beams account. Here are the
51
51
- Select your instance from the list or create a new instance.
52
52
- Click on the "Settings" tab.
53
53
- Upload your APNS Certificate and/or add your FCM Server key.
54
- - Now select the "Credentials " tab.
54
+ - Now select the "Keys " tab.
55
55
- Copy your ` Instance Id ` , and ` Secret Key ` .
56
56
- Add a new entry to in your ` config/services.php ` file:
57
57
``` php
@@ -66,7 +66,7 @@ Before using this package you should set up a Pusher Beams account. Here are the
66
66
67
67
Now you can use the channel in your ` via() ` method inside the Notification class.
68
68
69
- ``` php
69
+ ``` php
70
70
use NotificationChannels\PusherPushNotifications\PusherChannel;
71
71
use NotificationChannels\PusherPushNotifications\PusherMessage;
72
72
use Illuminate\Notifications\Notification;
@@ -132,18 +132,12 @@ public function toPushNotification($notifiable)
132
132
By default, the pusher "interest" messages will be sent to will be defined using the {notifiable}.{id} convention, for example ` App.User.1 ` ,
133
133
however you can change this behaviour by including a ` routeNotificationFor() ` in the notifiable class.
134
134
135
- I.e. if you are pushing notification on `` User `` model, you can go to ` App\User ` class and implement method:
135
+ I.e. if you are pushing notification on ` User ` model, you can go to ` App\Models \User ` class and implement method:
136
136
137
- ```
138
- public function routeNotificationFor($channel)
137
+ ``` php
138
+ public function routeNotificationForPusherPushNotifications($notification): string
139
139
{
140
- if($channel === 'PusherPushNotifications'){
141
- return 'your.custom.interest.string';
142
- }
143
-
144
- $class = str_replace('\\', '.', get_class($this));
145
-
146
- return $class.'.'.$this->getKey();
140
+ return 'your.custom.interest.string';
147
141
}
148
142
```
149
143
@@ -168,7 +162,7 @@ Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recen
168
162
169
163
## Testing
170
164
171
- ``` bash
165
+ ``` bash
172
166
$ composer test
173
167
```
174
168
0 commit comments