- Can I use symfony/mobyt-notifier directly in a Laravel application without Symfony?
- Yes, you can integrate this package into Laravel since Laravel’s Notification system is built on Symfony Notifier. The bridge works as a standalone transport for sending SMS via Mobyt, requiring no full Symfony app setup. Just install the dependencies and configure the DSN in your `.env` file.
- What Laravel versions are compatible with symfony/mobyt-notifier?
- This package requires PHP 8.4+, so it works best with Laravel 10.x+ (which uses PHP 8.2+). If you’re on Laravel 9.x or earlier, you may need to downgrade Symfony Notifier to a compatible version or upgrade your Laravel installation. Always check Symfony Notifier’s version constraints for alignment.
- How do I configure Mobyt Notifier in Laravel’s .env file?
- Add the `MOBYT_DSN` entry to your `.env` file using the format: `MOBYT_DSN=mobyt://USER_KEY:ACCESS_TOKEN@default?from=SENDER_PHONE&type_quality=N`. Replace placeholders with your Mobyt credentials, sender phone number, and message quality (N for high, L for medium, LL for low).
- Does this package support custom SMS options like scheduling or delivery reports?
- Yes, you can use the `MobytOptions` class to customize messages, including setting message type quality (high, medium, low) and other Mobyt-specific parameters. Refer to the Mobyt API documentation for all available options, as the package abstracts these through Symfony Notifier’s extensible message system.
- Will this package work with Laravel’s built-in Notification system (e.g., Notifiable trait)?
- Yes, since Laravel Notifications is built on Symfony Notifier, you can register the Mobyt transport as a custom channel. Extend Laravel’s `NotificationChannel` or use a service provider to bind the Symfony transport, then define a `via()` method in your notification class to use the Mobyt channel.
- Are there any known conflicts between symfony/notifier and Laravel’s internal Symfony components?
- Potential conflicts may arise if Laravel’s bundled Symfony components (e.g., in Laravel 10+) differ from the version required by `symfony/notifier`. Always check your `composer.json` for version constraints and consider using `platform-check` or `platform-req` in Composer to enforce compatibility.
- How do I handle Mobyt API rate limits or failures in production?
- The package itself doesn’t include retry logic or fallback mechanisms, so you’ll need to implement these at the application level. Use Laravel’s `ShouldQueue` interface for delayed retries or integrate a queue worker like Supervisor to handle transient failures. Consider caching failed messages for manual review.
- What’s the difference between Mobyt’s message quality options (N, L, LL), and how do they affect costs?
- Mobyt’s message quality options (`N` for high, `L` for medium, `LL` for low) typically impact delivery speed and cost. High-quality messages (N) may have better deliverability but could cost more per SMS. Check Mobyt’s pricing documentation to align quality settings with your budget and use case.
- Is there a Laravel-specific wrapper or alternative to symfony/mobyt-notifier?
- As of now, there are no widely adopted Laravel-specific wrappers for Mobyt. This Symfony bridge is the most direct integration path. If you need tighter Laravel integration (e.g., queue jobs, event listeners), you may need to build a facade or service class on top of the Symfony transport.
- How do I test Mobyt Notifier in a Laravel application before going to production?
- Use Mobyt’s sandbox environment (if available) or mock the transport in tests by creating a custom test transport that extends `MobytTransport`. Override the `send()` method to log or assert messages without hitting the real API. Laravel’s `NotificationFake` can also help verify notifications are dispatched correctly.