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

yibr's avatar
Level 23

nexmo laravel Unauthorized

hi i started to use nexmo through laravel nexmo laravel

and for sending a message it works very well but for calls it didn't work

i found an issue related but no solution https://github.com/Nexmo/nexmo-php/issues/129

if someone can help me regarding this

if you want to see the code

    Nexmo::message()->send([
    'to'   => '14845551244',
    'from' => '16105552344',
    'text' => 'Using the facade to send a message.'
]);

this has worked but not this i gett the error Unauthorized

Nexmo::calls()->create([
    'to' => [[
        'type' => 'phone',
        'number' => '14155550100'
    ]],
    'from' => [
        'type' => 'phone',
        'number' => '14155550101'
    ],
    'answer_url' => ['https://example.com/webhook/answer'],
    'event_url' => ['https://example.com/webhook/event']
]);

and i tried on my local machine trough -curl an example from the docs and it works but not from laravel

thanks

0 likes
1 reply
aurawindsurfing's avatar

@yibr it is probably related to nexmo not being able to access your local developement.

When you send a text then it only goes outside. When you make a call it looks like it is looking for your local url address for process the webhook.

If you are using Laravel Valet then this would be something to look into: https://laravel.com/docs/5.8/valet#sharing-sites

If it is Homestead then I'm not sure how it is done as it is a separate virtual machine and would need some port forwarding.

Hope this points you in the right direction.

Please or to participate in this conversation.