- Can I use Symfony Infobip Notifier directly in Laravel without Symfony components?
- No, this package requires Symfony Notifier (symfony/notifier) and related components like symfony/http-client. You’ll need to install these dependencies via Composer and bridge them into Laravel’s service container. The package itself is lightweight but relies on Symfony’s ecosystem.
- How do I configure the Infobip DSN in Laravel’s .env file?
- Add `INFOBIP_DSN=infobip://YOUR_AUTH_TOKEN@HOST?from=SENDER_ID` to your `.env` file. Replace `YOUR_AUTH_TOKEN` with your Infobip API key, `HOST` with your Infobip endpoint (e.g., `api.infobip.com`), and `SENDER_ID` with your sender identity (e.g., `YourBrand`). This follows Laravel’s environment-based configuration pattern.
- Does this package support Laravel’s queue system for async SMS delivery?
- Yes, wrap the Symfony Notifier in a Laravel job (e.g., `SendNotificationJob`) to leverage queues. This avoids blocking HTTP requests and aligns with Laravel’s async workflows. The package itself doesn’t handle queues natively, so you’ll need to implement the job wrapper manually.
- What Laravel versions are compatible with Symfony Infobip Notifier?
- This package doesn’t enforce Laravel version constraints directly, but it requires Symfony Notifier (v6.x or v7.x) and related components. Ensure your Laravel app (8.x+) can coexist with these Symfony dependencies. Test thoroughly for version conflicts, especially with symfony/http-client.
- How do I handle API failures or retries with Infobip in Laravel?
- The package lacks built-in retry logic, so implement a decorator pattern to wrap the transport. For example, create a `RetryableInfobipTransport` class that uses Laravel’s retry helper or a custom retry strategy. This ensures resilience against Infobip API rate limits or transient failures.
- Can I use this package alongside Laravel Notifications (e.g., Twilio, Mailgun)?
- Yes, Symfony Notifier supports multiple transports, so you can mix Infobip with other channels like email or push notifications. Configure each transport separately in your Laravel service container and dispatch notifications through Symfony’s unified `Notifier` interface.
- Are there Laravel-specific examples or documentation for this package?
- No, the package is Symfony-focused, so Laravel-specific examples are minimal. You’ll need to adapt Symfony’s patterns (e.g., service container binding, event dispatching) to Laravel’s conventions. Check the Symfony Notifier docs for core concepts and bridge them manually.
- What are the risks of using this package in production?
- Key risks include dependency conflicts with Symfony components, lack of Laravel-native testing, and minimal adoption (3 stars, 0 dependents). Mitigate by explicitly version-locking dependencies in `composer.json`, implementing custom retry logic, and testing thoroughly for edge cases like API failures or rate limits.
- How do I integrate Symfony Notifier with Laravel’s event system?
- Map Symfony’s `MessageSentEvent` or `TransportFailedEvent` to Laravel’s events by creating event listeners. Use Symfony’s `EventDispatcher` and register it in Laravel’s service container. For example, dispatch a `NotificationSent` event in Laravel when Symfony’s event fires, then listen for it in your app.
- What alternatives exist for Infobip SMS in Laravel, and why choose this package?
- Alternatives include Twilio, AWS SNS, or Laravel’s native `Notification` facade with custom Infobip HTTP clients. Choose this package if you prefer Symfony’s Notifier ecosystem, need multi-channel support (SMS + email/push), or want DSN-based configuration. It’s ideal for apps already using Symfony components or requiring unified notification workflows.