laravel/nexmo-notification-channel
Laravel Vonage (Nexmo) Notification Channel adds SMS support to Laravel notifications via Vonage. Configure credentials, define a toVonage method on notifications, and send messages to users through the built-in notification system.
Notification facade, enabling seamless integration with existing event-driven architectures (e.g., notifiable models, queues, or broadcast channels).Notification classes can be extended with VonageChannel without rewriting core logic..env, reducing hardcoding risks.database, redis), enabling async SMS delivery—critical for scalability.429 (Too Many Requests) or 5xx errors. Retry logic (e.g., exponential backoff) must be implemented at the application level.Illuminate\Notifications system. Works alongside Mail, Slack, or Database channels.text).User::sendNotification(new OrderShipped)).composer require laravel/vonage-notification-channel
.env:
VONAGE_KEY=your_api_key
VONAGE_SECRET=your_api_secret
VONAGE_FROM=YourApp
php artisan vendor:publish --provider="Vonage\NotificationChannel\VonageServiceProvider"
use Vonage\NotificationChannel\VonageChannel;
class OrderShipped implements ShouldQueue
{
public function via($notifiable)
{
return [VonageChannel::class];
}
public function toVonage($notifiable)
{
return "Your order #{$this->orderId} has shipped!";
}
}
return "Hello {$notifiable->name}, your code is: {$this->code}";
Vonage facade in unit tests:
$this->mock(Vonage::class)->shouldReceive('sendSms')->once();
notifiable models, queues, and broadcast channels.ShouldQueue for async delivery.+1234567890). Validate with Vonage::validateNumber().Illuminate\Bus\PendingDispatch).dispatchSync for low-volume, dispatch for high-volume).storage/logs/laravel.log).redis or database queues with workers (e.g., Laravel Horizon).How can I help you explore Laravel packages today?