- How do I install laravel/vonage-notification-channel?
- Install the package with Composer using composer require laravel/vonage-notification-channel. You need a Laravel 10.x or newer project with PHP 8.1 or newer. After installation, add your Vonage credentials to the environment and services configuration before sending notifications.
- How do I configure Vonage credentials for Laravel SMS notifications?
- Add VONAGE_SID, VONAGE_AUTH_TOKEN, and VONAGE_FROM to your .env file. Then define a vonage entry in config/services.php with sid, auth_token, and from values pulled from those environment variables. Clear or rebuild Laravel's configuration cache after changing these values.
- Which Laravel versions support laravel/vonage-notification-channel?
- The package is designed for Laravel 10.x and newer and requires PHP 8.1 or newer. Because it integrates tightly with Laravel's notification system, test compatibility early when upgrading to a new Laravel major version.
- How do I send an SMS notification with Vonage in Laravel?
- Create a notification class whose via method returns the vonage channel, and build the message with Laravel's VonageMessage class. Then send it through Laravel's notification system, for example by calling notify on a notifiable model. For background delivery, make the notification implement ShouldQueue.
- Can I queue Vonage SMS notifications in Laravel?
- Yes. The channel works with Laravel's queue system, so you can make the notification implement ShouldQueue and let a queue worker deliver the SMS asynchronously. This keeps SMS API calls out of the request cycle and improves application performance.
- How do I test Vonage SMS notifications without sending real messages?
- Use Laravel's Notification::fake() to assert that notifications are sent without calling Vonage. For integration testing, use Vonage's sandbox environment where possible and keep live API credentials out of CI. The package includes unit tests and GitHub Actions workflows that reduce integration risk.
- What are alternatives to laravel/vonage-notification-channel?
- Alternatives include other SMS providers' Laravel notification channels, such as Twilio, or a custom notification channel built directly on Vonage's PHP SDK. This official package is a good fit when you already use Vonage and want minimal boilerplate inside Laravel's notification system.
- Is laravel/vonage-notification-channel maintained?
- Yes. It is an official Laravel package released under the MIT license and includes GitHub Actions test workflows. Check Packagist and the GitHub repository for the latest stable version and compatibility notes before upgrading.
- What are production concerns for Vonage SMS notifications in Laravel?
- Watch for Vonage API rate limits, downtime, and SMS costs as volume grows. Use Laravel queue retries and fallback notification channels where appropriate, and log or monitor delivery failures. Also pre-process messages for SMS character limits and Unicode handling when needed.
- Can I use Vonage SMS notifications for OTP and transactional alerts?
- Yes. The channel is suited to OTPs, alerts, and transactional updates sent through Laravel notifications. Keep SMS length and Unicode constraints in mind, and add custom logging or auditing if your use case requires compliance records.