laravel/vonage-notification-channel
Official Laravel notification channel for sending SMS via Vonage (formerly Nexmo). Integrates with Laravel’s Notifications system to deliver text messages to notifiable users using your Vonage credentials and configuration.
Notification facade, Notifiable contracts, and event-driven workflows).config/services.php and AppServiceProvider.retry-after support) and fallback channels.tenants table?User::send(new OTPNotification)). Works alongside other channels (e.g., Mail, Slack).illuminate/notifications installed.composer require laravel/vonage-notification-channel
.env:
VONAGE_SID=your_sid
VONAGE_AUTH_TOKEN=your_token
VONAGE_FROM=YourApp
config/services.php:
'vonage' => [
'sid' => env('VONAGE_SID'),
'auth_token' => env('VONAGE_AUTH_TOKEN'),
'from' => env('VONAGE_FROM', 'YourApp'),
],
AppServiceProvider:
NotificationChannel::extend('vonage', function ($app) {
return new \Laravel\Vonage\VonageChannel(
$app->make('vonage'),
$app['config']['services.vonage.from']
);
});
use Illuminate\Notifications\Notification;
use Laravel\Vonage\VonageMessage;
class OTPNotification extends Notification {
public function via($notifiable) {
return ['vonage'];
}
public function toVonage($notifiable) {
return VonageMessage::content('Your OTP: ' . $this->otp);
}
}
$user->notify(new OTPNotification($otp));
failed_jobs table or Horizon.from number format (e.g., +1234567890), rate limits.retry-after or batch processing.throttle:60,1 in notification class) for high-volume senders.from number is region-appropriate for recipients.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Vonage API downtime | SMS notifications fail silently. | Fallback to email/push; retry with exponential backoff. |
| Rate limit exceeded | Notifications queue or fail. | Implement retries with retry-after header. |
Invalid from number |
Messages rejected by Vonage. | Validate number format in config. |
| Laravel queue overload | Delayed notifications. | Scale queue workers; monitor queue length. |
| Cost overrun | Unexpected billing spikes. | Set budget alerts in Vonage dashboard. |
How can I help you explore Laravel packages today?