diff --git a/composer.json b/composer.json index d8f8b35..283b5bb 100644 --- a/composer.json +++ b/composer.json @@ -18,10 +18,10 @@ ], "require": { "php": ">=7.2", + "illuminate/events": "~6.0 || ~7.0 || ~8.0", "illuminate/notifications": "~6.0 || ~7.0 || ~8.0", "illuminate/support": "~6.0 || ~7.0 || ~8.0", - "illuminate/events": "~6.0 || ~7.0 || ~8.0", - "plivo/plivo-php": "^1.1" + "plivo/plivo-php": "^4.0" }, "require-dev": { "mockery/mockery": "^1.3", diff --git a/src/Plivo.php b/src/Plivo.php index 7b0b8e0..99e54dc 100644 --- a/src/Plivo.php +++ b/src/Plivo.php @@ -2,7 +2,7 @@ namespace NotificationChannels\Plivo; -use Plivo\RestAPI as PlivoRestApi; +use Plivo\RestClient as PlivoRestApi; class Plivo extends PlivoRestApi { diff --git a/src/PlivoChannel.php b/src/PlivoChannel.php index eb36c11..92f8a7f 100644 --- a/src/PlivoChannel.php +++ b/src/PlivoChannel.php @@ -48,11 +48,11 @@ public function send($notifiable, Notification $notification) $message = new PlivoMessage($message); } - $response = $this->plivo->send_message([ - 'src' => $message->from ?: $this->from, - 'dst' => $to, - 'text' => trim($message->content), - ]); + $response = $this->plivo->messages->create( + $message->from ?: $this->from, + [$to], + trim($message->content), + ); if ($response['status'] !== 202) { throw CouldNotSendNotification::serviceRespondedWithAnError($response);