Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lemmon's avatar
Level 28

Problems sending sms using laravel/nexmo-notifications-channel

Hello please help.

getting this error trying to send sms text using nexmo 'which is now vonage?'

Http\Client\Exception\RequestException cURL error 60: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

I am using laravel6

I have installed laravel/nexmo-notifications-channel

I am using wamp as a local dev server

Here is my notificatons class

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\NexmoMessage;

class PaymentReceived extends Notification
{
    use Queueable;

    public $amount;

    /**
     * Create a new notification instance.
     *
     * @param $amount
     */
    public function __construct($amount)
    {
        $this->amount = $amount;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail', 'database', 'nexmo'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        $money = $this->amount;

        return (new MailMessage)
            ->subject('We got Your Money')
            ->greeting('Whats up?')
            ->line("We stole {$money} from you")
            ->action('Click Here!', url('http://google.com'))
            ->line('And see what happens');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            'amount' => $this->amount
        ];
    }

    /**
     * Get the Nexmo / SMS representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return NexmoMessage
     */
    public function toNexmo($notifiable)
    {
        return (new NexmoMessage())
            ->content('Did we do it?');
    }
}

Here is the controller

<?php

namespace App\Http\Controllers;

use NumberFormatter;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use App\Notifications\PaymentReceived;
use Illuminate\Support\Facades\Notification;

class PaymentsController extends Controller
{
    public function create()
    {
        return view('payments.create');
    }

    public function store()
    {
        // use below to notify one person
        request()->user()->notify(new PaymentReceived(999));

        // use below for notifying group of people
        /*Notification::send(request()->user(), new PaymentReceived());*/

        /*return redirect('/payments/create')
            ->with('message', "Payment Sent!");*/

        /*ddd(request()->user()->email);*/
    }
}

here is the error I am getting

Http\Client\Exception\RequestException cURL error 60: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

0 likes
4 replies
jayantr1992's avatar

I have followed the given solution now I am getting a different error

Non White-listed Destination - rejected

Well, I have found the issue. I need to add country code before the phone number

public function routeNotificationForNexmo($notification) { return '';e.g 919876543210 (91 is India's Country code) }

kahilu's avatar

@jayantr1992 Hard Truth Non White-listed Destination - rejected comes because Vonage Only Allows to send to the registered number While you Have a Vonage Trial Account... you can register up to 4 numbers in you trial version. for more. check this link... help.nexmo.com/hc/en-us/articles/204014853-How-do-I-add-test-numbers-during-my-Vonage-API-trial-

Please or to participate in this conversation.