How generatorevil/sms-routing works
This Laravel package routes SMS notifications through country-specific or regional gateway chains, failing over in priority order. The main workflow is notification channel → manager (country resolution, route selection, rate-limit check, and dispatch) → provider gateway → normalized result; successful sends also dispatch an event. The README documents nine providers, multi-account instances, per-gateway OTP templates, and delivery events. Some manager and gateway source is excerpted only, so uncertain internal calls are omitted; provider capabilities and routing behavior are also supported by the README.
Main entry points: Gateways Provider gateways · SmsManager.php SMS manager · SmsChannel.php SMS channel · SmsResultDTO.php Send result
Components 19
Notification entry
- SMS channel
src/Channels/SmsChannel.php
Routing and controls
- SMS manager
src/SmsManager.php - SMS configuration
config/sms.php - Country resolver
src/PhoneCountryResolver.php - Rate limiter
src/Contracts/SmsRateLimiter.php - Null limiter
src/RateLimit/NullSmsRateLimiter.php
Provider adapters
- Provider gateways
src/Gateways - Gateway base
src/Gateways/AbstractSmsGateway.php - Provider clients
src/Clients - SMSC client
src/Clients/SmscClient.php - Botto client
src/Clients/BottoClient.php - Karix client
src/Clients/KarixClient.php - Laaffic client
src/Clients/LaafficClient.php - SigmaSMS client
src/Clients/SigmaSmsClient.php - SMSFly client
src/Clients/SmsFlyClient.php
Results and events
- Send result
src/DTOs/SmsResultDTO.php - Delivery event
src/Events/SmsSent.php
Other components
- Laravel application
- SMS providers
Connections 20
- Laravel application → SMS channel: sends notification
README.md - SMS channel → SMS manager: delegates send
src/Channels/SmsChannel.php - SMS manager → Country resolver: resolves country
src/SmsManager.php - SMS manager → SMS configuration: reads routes
README.md - SMS manager → Rate limiter: checks and records
src/SmsManager.php - Rate limiter → Null limiter: defaults to
src/SmsRoutingServiceProvider.php - SMS manager → Provider gateways: dispatches chain
src/SmsManager.php - Provider gateways → Gateway base: extends base
src/Gateways/SmscGateway.php - Provider gateways → Provider clients: uses clients
src/Gateways/BottoGateway.php - Provider gateways → SMSC client: calls send
src/Gateways/SmscGateway.php - Provider gateways → Botto client: uses client
src/Gateways/BottoGateway.php - Provider gateways → Karix client: uses client
src/Gateways/KarixGateway.php - Provider gateways → Laaffic client: uses client
src/Gateways/LaafficGateway.php - Provider gateways → SigmaSMS client: uses client
src/Gateways/SigmasmsGateway.php - SMS manager → SMSFly client: dispatches SMSFly
- Provider gateways → SMS providers: sends SMS
README.md - Provider gateways → Send result: returns result
src/Gateways/SmscGateway.php - SMS manager → Send result: returns outcome
src/SmsManager.php - SMS channel → Delivery event: dispatches success event
src/Channels/SmsChannel.php - Delivery event → Send result: carries result
src/Events/SmsSent.php