- Can I use this bundle directly in Laravel without Symfony?
- No, this is a Symfony bundle, so you’ll need to integrate it via the Symfony Bridge (symfony/bridge) or manually bind its services to Laravel’s container. If your app isn’t Symfony-based, consider alternatives like spatie/laravel-sms for native Laravel support.
- How do I configure the bundle for Laravel’s .env system?
- The bundle expects SMS_USERNAME, SMS_PASSWORD, and SMS_ACCOUNT in .env, but you may need to wrap its config loader in Laravel’s config() helper or use a package like vlucas/phpdotenv to bridge Symfony’s config system with Laravel’s.
- Does this bundle support Laravel Queues for async SMS sending?
- No, it doesn’t natively integrate with Laravel Queues. You’d need to wrap its SMS service in a Laravel Job or call it via HTTP from a queue worker, as the bundle lacks built-in queue support.
- What Laravel versions are compatible with this bundle?
- The bundle’s last update (2025-02-24) suggests PHP 8.1+ compatibility, but Laravel version support isn’t explicitly documented. Test thoroughly with your Laravel version (e.g., 9.x or 10.x) and ensure Symfony Bridge compatibility.
- How do I test SMS sending without hitting the real API?
- Set SMS_TEST=true in your .env to disable API calls. However, for Laravel unit tests, you may need to mock the bundle’s HTTP client (e.g., with Mockery) since its testing mode isn’t Laravel-native.
- Are there alternatives for Laravel that support more SMS providers?
- Yes, consider spatie/laravel-sms (multi-provider) or vonage/client (Twilio-compatible) for broader support. This bundle is locked to dinaSMS, Acumbamail, and Smspubli, requiring custom work for other providers.
- How do I send an SMS programmatically in Laravel?
- The bundle lacks Laravel-specific examples, but you’d typically inject its SMS service (e.g., via Symfony Bridge) and call methods like sendSms($phone, $message). Check the bundle’s src/SMSService.php for available methods.
- What’s the maintenance status of this package?
- The last update was in 2025, but the project has no stars or dependents, raising concerns about long-term maintenance. Review the GitHub issues for unresolved bugs or feature requests before adoption.
- Can I use this bundle in production without issues?
- Yes, but ensure SMS_TEST=false in production and monitor API credits (via /smsBundle/ endpoint). However, the lack of Laravel-native logging or error handling means you’ll need to wrap its output in Laravel’s Log facade.
- How do I handle errors if the SMS API fails?
- The bundle doesn’t document error handling, so you’ll need to catch exceptions from its SMS service (e.g., GuzzleHttpException) and log them via Laravel’s Log::error(). Consider adding retry logic for transient failures.