Skip to content

configuration

alizeinodin edited this page Sep 11, 2026 · 2 revisions

Configuration

Published file: config/smsapi.php (config key: smsapi).

Important keys

Key Purpose
default Default driver / connection name
drivers.* Provider credentials
connections.* Named accounts (e.g. smsir-otp)
templates.* Logical template → provider IDs
messages.* Policies (otp, marketing, …)
queue.* Queue aliases & retry
otp.channel Default template channel (sms/mail/both)
otp.vault.* Optional OTP vault
otp.redact.* Redact CODE in logs
resilience.* Circuit breaker + rate limits
logging.* Persist to sms_logs
phone.* Iranian number normalization

Named connections

'connections' => [
    'smsir-otp' => [
        'driver' => 'smsir',
        'api_key' => env('SMSAPI_OTP_API_KEY'),
        'line_number' => env('SMSAPI_OTP_LINE'),
    ],
],
Sms::connection('smsir-otp')->sendTemplate(...);
Sms::driver('smsir-otp')->send(...); // same

Environment flags

Boolean env values use FILTER_VALIDATE_BOOLEAN (so false / 0 / off work correctly):

SMSAPI_OTP_VAULT_ENABLED=true
SMSAPI_OTP_REDACT=true
SMSAPI_LOGGING_ENABLED=false
SMSAPI_RATE_LIMIT_ENABLED=true

Clone this wiki locally