whatsapp_number ?? null; $verified = $notifiable->whatsapp_verified_at ?? null; if ($to === null || $verified === null) { return; } $body = method_exists($notification, 'toVonageWhatsApp') ? $notification->toVonageWhatsApp($notifiable) : null; if ($body === null) { return; } $url = 'https://api.nexmo.com/v1/messages'; try { $this->apiLogger->send(self::NAME, 'POST', $url, fn () => Http::timeout(10) ->withBasicAuth($key, $secret) ->acceptJson() ->post($url, [ 'message_type' => 'text', 'channel' => 'whatsapp', 'from' => $from, 'to' => $to, 'text' => $body, ])); } catch (Throwable $e) { Log::error('VonageWhatsAppChannel: send failed', ['error' => $e->getMessage()]); } } }