/** * Send the given notification. * * @param mixed $notifiable * @param \Illuminate\Notifications\Notification $notification * @return void */ public function send($notifiable, Notification $notification) { if (!($to = $notifiable->routeNotificationFor('nexmo'))) { return; } $message = $notification->toNexmo($notifiable); if (is_string($message)) { $message = new NexmoMessage($message); } $this->nexmo->message()->send(['from' => $message->from ?: $this->from, 'to' => $to, 'text' => trim($message->content)]); }