overtrue/easy-sms, a mature PHP SMS library with multi-gateway support (Aliyun, Twilio, AWS SNS, etc.). This is a strong technical foundation for SMS functionality.config/ + service container model.AppKernel, NodeDefinition). High for Laravel projects using Symfony components (e.g., Lumen, Laravel with Symfony Bridge).symfony/framework-bundle (v5.4–7.4): Requires Symfony integration or a polyfill.overtrue/easy-sms (v1.1+): Can be used standalone in Laravel if the bundle layer is bypassed.overtrue/easy-sms directly in Laravel (recommended for simplicity).AppKernel, NodeDefinition) won’t work out-of-the-box.config/ + environment variables).overtrue/easy-sms standalone first).laravel-notification-channels/sms (Laravel-native).nesbot/carbon + custom SMS service (if gateway-specific).overtrue/easy-sms directly in Laravel.easy-sms. Verify compatibility with target providers.overtrue/easy-sms actively maintained?| Component | Laravel Fit | Notes |
|---|---|---|
| Symfony Bundle | ❌ No | Requires wrapper or Symfony integration. |
overtrue/easy-sms |
✅ Yes | Directly usable in Laravel (recommended). |
| YAML Config | ⚠️ Partial | Laravel uses config/ + .env. Adapt via service provider. |
| Dependency Injection | ✅ Yes | Laravel’s IoC container can bind EasySms services. |
| Gateways | ✅ Yes | Supports Aliyun, Twilio, AWS SNS, etc. (via easy-sms). |
overtrue/easy-sms Integration (Recommended)easy-sms:
composer require overtrue/easy-sms
config/sms.php:
return [
'default' => 'aliyun',
'gateways' => [
'aliyun' => [
'access_key_id' => env('ALIYUN_ACCESS_KEY'),
'access_key_secret' => env('ALIYUN_ACCESS_SECRET'),
'sign_name' => env('ALIYUN_SIGN_NAME'),
],
],
];
// app/Providers/SmsServiceProvider.php
use Overtrue\EasySms\EasySmsFactory;
class SmsServiceProvider extends ServiceProvider {
public function register() {
$this->app->singleton('sms', function () {
return EasySmsFactory::make(config('sms.gateways'));
});
}
}
use Illuminate\Support\Facades\Sms;
Sms::send('1234567890', 'Hello from Laravel!');
composer require akanunov/easy-sms-bundle
akanunov_easy_sms config into Laravel’s config/sms.php.// app/Facades/Sms.php
public static function send($phone, $message) {
return app('sms')->send($phone, $message);
}
Mailable for SMS).overtrue/easy-sms standalone (lowest risk).overtrue/easy-sms is actively maintained (unlike the bundle).easy-sms for breaking changes.overtrue/easy-sms (GitHub issues, docs).easy-sms directly. Higher if deeply tied to bundle.easy-sms is lightweight (HTTP requests to gateways).| Scenario | Impact | Mitigation |
|---|---|---|
| Gateway API failure | SMS delivery fails silently. | Implement retry logic + alerts. |
| Configuration errors | No SMS sent (silent failure). | Validate config on app boot. |
| Symfony bundle issues | Breaks if Laravel updates. | Use easy-sms directly. |
| Rate limiting | Throttled requests. | Queue delays + exponential backoff. |
How can I help you explore Laravel packages today?