Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | public function send($notifiable, Notification $notification) |
||
29 | { |
||
30 | $message = $notification->toAfricasTalking($notifiable); |
||
|
|||
31 | |||
32 | if (! $phoneNumber = $notifiable->routeNotificationFor('africasTalking')) { |
||
33 | $phoneNumber = $notifiable->phone_number; |
||
34 | } |
||
35 | |||
36 | try { |
||
37 | $this->africasTalking->send([ |
||
38 | 'to' => $phoneNumber, |
||
39 | 'message' => $message->getContent(), |
||
40 | 'from' => $message->getSender(), |
||
41 | ]); |
||
42 | } catch (Exception $e) { |
||
43 | throw CouldNotSendNotification::serviceRespondedWithAnError($e->getMessage()); |
||
44 | } |
||
47 |