- Can I use symfony/nexmo-notifier directly in Laravel without Symfony’s Messenger?
- Yes, but you’ll need a wrapper. Create a Laravel service provider to instantiate the Symfony Notifier with the Nexmo bridge, then dispatch messages via Laravel Queues. This avoids pulling in full Symfony Messenger. Example: Register a facade or manager class to abstract the Symfony dependency.
- What Laravel versions support symfony/nexmo-notifier?
- The package itself has no Laravel-specific dependencies, but it requires PHP 8.1+. For Laravel compatibility, ensure your app uses Symfony components (e.g., HTTP client) that align with your Laravel version. Test thoroughly—Laravel’s DI container differs from Symfony’s.
- How do I configure Vonage API keys in Laravel?
- Store keys in `.env` (e.g., `VONAGE_KEY`, `VONAGE_SECRET`). Pass them to the Symfony Notifier via environment variables or a config file. The bridge expects a DSN format like `vonage://key:secret@api.vonage.com`. Use Laravel’s `config/services.php` to centralize settings.
- Is this package maintained? Should I use it for production?
- The package is deprecated in favor of Symfony’s Vonage bridge, with the last release in October 2024. No archival notice exists, but maintenance risks are higher. For production, consider forking or using the official `vonage/client-php` SDK as a backup. Monitor GitHub issues for updates.
- Can I integrate this with Laravel Notifications (e.g., `Notifiable` trait)?
- No, this bridge doesn’t natively support Laravel’s Notifiable trait. You’ll need to manually construct messages and dispatch them via Laravel Queues or a custom facade. For seamless Notifiable integration, use `notifications-channels/nexmo` instead.
- How do I handle errors like API rate limits or failed SMS deliveries?
- Leverage Laravel’s queue system for retries. Wrap the Symfony Notifier in a try-catch block to log errors (e.g., using Laravel’s logging). For rate limits, implement exponential backoff in your queue worker or use Vonage’s API callback webhooks for real-time alerts.
- What’s the difference between this and `vonage/client-php`?
- This package is a Symfony Notifier bridge, adding abstraction for Symfony Messenger or Notifier users. `vonage/client-php` is the official SDK with lower overhead but no Symfony integration. Choose this if you’re already using Symfony components; otherwise, `vonage/client-php` is simpler and more actively maintained.
- Will this work with Laravel’s Horizon for queue monitoring?
- Yes, if you dispatch messages via Laravel Queues. The Symfony Notifier runs inside your queue worker, so Horizon will track job progress, failures, and retries. Ensure your queue driver (e.g., Redis, database) supports delayed jobs for reliability.
- Can I use this for two-way messaging (e.g., chatbots with inbound SMS)?
- The bridge supports outbound SMS/voice, but inbound messages require Vonage’s webhook endpoints. Configure a Laravel route to handle webhooks (e.g., `/vonage/webhook`) and parse incoming messages manually. This isn’t a built-in feature of the bridge.
- Are there Laravel-specific alternatives to this package?
- Yes, consider `notifications-channels/nexmo` or `laravel-notification-channels/nexmo` for tighter Laravel integration. These packages support the Notifiable trait, Laravel events, and queue workers out of the box. They’re more actively maintained and Laravel-idiomatic.