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