From 87cc9d7d8b4b03401c9c16061fcf8ddc738b5a56 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 8 Feb 2022 10:32:18 +0100 Subject: [PATCH 1/2] Add part for channel name changes --- UPGRADE.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/UPGRADE.md b/UPGRADE.md index 2eb4fac..2874c68 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -38,7 +38,7 @@ If you were depending on functionality from `nexmo/laravel` you may now use it d ```php use Vonage\Client; -$vonageClient = app()->make(Client::class); +$vonageClient = app(Client::class); ``` If you were using the `Nexmo` facade from `nexmo/laravel`, you should update your code to use the `Vonage` facade instead: @@ -81,6 +81,29 @@ VONAGE_SMS_FROM=15556666666 Once you have defined this environment variable, you may remove the `nexmo` configuration entry from your `services` configuration file. +### Channel Name Changes + +The channel name for `nexmo` was changed to `vonage`. This means you'll need to update the `nexmo` reference in the `via` method of your notifiables to `vonage`: + +```php +/** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ +public function via($notifiable) +{ + return $notifiable->prefers_sms ? ['vonage'] : ['mail', 'database']; +} +``` + +As well as the channel name when routing notifications: + +```php +Notification::route('vonage', '5555555555')->notify(new InvoicePaid($invoice)); +``` + ### Class / Method Renaming All references to Nexmo have been updated to Vonage, including class names and method names. From 96220ee29315da3606e29691dc517e72de2c505a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 8 Feb 2022 08:43:00 -0600 Subject: [PATCH 2/2] Update UPGRADE.md --- UPGRADE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 2874c68..70984ce 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -81,9 +81,9 @@ VONAGE_SMS_FROM=15556666666 Once you have defined this environment variable, you may remove the `nexmo` configuration entry from your `services` configuration file. -### Channel Name Changes +### Notification Channel Name -The channel name for `nexmo` was changed to `vonage`. This means you'll need to update the `nexmo` reference in the `via` method of your notifiables to `vonage`: +The notification channel's name has been updated to `vonage`. Therefore, you should update all `nexmo` channel references in the `via` methods of your notifications to `vonage`: ```php /** @@ -98,7 +98,7 @@ public function via($notifiable) } ``` -As well as the channel name when routing notifications: +In addition, any ad-hoc notifications that were previously routing via `nexmo` should have their routing updated to `vonage`: ```php Notification::route('vonage', '5555555555')->notify(new InvoicePaid($invoice));