Nexmo / nexmo-laravel

Add Vonage functionality such as SMS and voice calling to your Laravel app with this Laravel Service Provider.
MIT License
317 stars 79 forks source link

Error sending SMS #63

Closed D144 closed 1 year ago

D144 commented 3 years ago

I am trying to send an SMS message using this package, following the example laid out in the documentation, but I get an error that I cannot figure out.

Expected Behavior

Here is the code I'm using

$nexmo = app('Vonage\Client');

$nexmo->message()->send([
  'to' => '516...',
  'from' => 'John Doe',
  'text' => 'Test message',
]);

NEXMO_KEY and NEXMO_SECRET are both set in the .env file

I would expect the message to be sent to my phone.

Current Behavior

When I run the code above I get the following error: TypeError: Too few arguments to function Vonage/Client::Vonage/{closure}(), 4 passed and exactly 5 expected

Your Environment

vladrusu commented 3 years ago

Had the same issue.

Solved it by upgrading to nexmo-notification-channel: ^2.5 (which requires nexmo/laravel ^2.4). Also, I had to remove tymon/jwt-auth, which is not PHP8 compatible yet. Keeping it, it locked vonage/client-core to version 2.5 or something (latest version is 2.9), which is not PHP8 compatible.

So, the culprit was basically tymon/jwt-auth for me.

SecondeJK commented 1 year ago

This package is officially abandoned in favour of https://github.com/Vonage/vonage-laravel. Please use that, and open tickets in that repo if required, thanks.