SmsSent, SmsFailed, DeliveryReportReceived) for decoupled observability, enabling integration with monitoring (e.g., Sentry, Datadog) or analytics (e.g., Mixpanel) without tight coupling.libphonenumber) and credential scrubbing in logs reduce security risks during integration.Hello {{name}}) and multi-language SMS, useful for global apps or localized campaigns.SmsFailed) sufficient, or are custom metrics (e.g., delivery latency) needed?^10.0). Leverages:
Notification system for SMS channels.SmsFailed events in a dashboard).Moffhub\SmsHandler\Contracts\Provider interface.sms_messages table (for tracking).sms_delivery_reports table (for webhooks).composer require moffhub/sms-handler.php artisan vendor:publish --provider="Moffhub\SmsHandler\SmsHandlerServiceProvider"..env (e.g., TWILIO_SID, AFRICAS_TALKING_API_KEY).config/services.php:
'sms' => [
'default' => 'twilio',
'providers' => [
'twilio' => ['class' => \Moffhub\SmsHandler\Providers\TwilioProvider::class],
// ... other providers
],
],
Sms facade or inject Moffhub\SmsHandler\Facades\Sms:
use Moffhub\SmsHandler\Facades\Sms;
Sms::send('+1234567890', 'Hello, {{name}}!', ['name' => 'John']);
config/sms.php:
'fallbacks' => [
'primary' => ['twilio', 'nexmo', 'africas_talking'],
],
Route::post('/sms/webhook', [SmsWebhookController::class, 'handle'])).SmsSent, SmsFailed:
event(new SmsSent($message));
Provider contract.How can I help you explore Laravel packages today?