Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function send($notifiable, Notification $notification) |
||
27 | { |
||
28 | /** @var PusherApiMessage $pusherApiMessage */ |
||
29 | $pusherApiMessage = $notification->toApiNotification($notifiable); |
||
|
|||
30 | |||
31 | $message = $pusherApiMessage->toArray(); |
||
32 | |||
33 | $response = $this->pusher::trigger( |
||
34 | $message['channels'], |
||
35 | $message['event'], |
||
36 | $message['data'], |
||
37 | $message['socketId'] ?? null, |
||
38 | $message['debug'] ?? false, |
||
39 | $message['alreadyEncoded'] ?? false |
||
40 | ); |
||
41 | |||
42 | if (! $response) { |
||
43 | throw CouldNotSendNotification::serviceRespondedWithAnError($response); |
||
44 | } |
||
47 |