| Conditions | 4 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 28 | public function send($notifiable, Notification $notification) |
||
| 29 | { |
||
| 30 | $message = $notification->toFacebook($notifiable); |
||
| 31 | |||
| 32 | if (is_string($message)) { |
||
| 33 | $message = FacebookMessage::create($message); |
||
| 34 | } |
||
| 35 | |||
| 36 | if ($message->toNotGiven()) { |
||
| 37 | if (! $to = $notifiable->routeNotificationFor('facebook')) { |
||
| 38 | throw CouldNotSendNotification::recipientNotProvided(); |
||
| 39 | } |
||
| 40 | |||
| 41 | $message->to($to); |
||
| 42 | } |
||
| 43 | |||
| 44 | $this->fb->send($message->toArray()); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |