Download the PHP package alizne/smsapi without Composer
On this page you can find all versions of the php package alizne/smsapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alizne/smsapi
More information about alizne/smsapi
Files in alizne/smsapi
Package smsapi
Short Description Laravel SMS & messenger package for Iranian providers (sms.ir, Kavenegar, Ghasedak, Melipayamak, …) with failover, templates, OTP vault, and queues
License MIT
Informations about the package smsapi
SMSApi
فارسی
Laravel package for Iranian SMS panels. Supports Laravel 10–13 on PHP 8.1+ (Laravel 13 requires PHP 8.3+). One API covers sms.ir, Kavenegar, Ghasedak, Melipayamak, Farazsms, Magfa, IPPanel, Niksms, Mediana, Avanak, LimoSMS, Amoot, Farapayamak, Payamito, Payamaknovin, Bahmanpayam, Payamresan, Behinpayam, Rastinsms, and other Iranian panels.
It also sends through Telegram, WhatsApp, Bale, Eitaa, Rubika, Gap, and iGap.
Use it to ship OTP delivery, multi-panel failover, and the rest of the outbound flow without a one-off client per provider.
Install
.env:
Local development without a real panel:
Optional features (logging, OTP vault, rate limiter, webhook) are off until you install them:
Usage
Failover
Or in .env:
A read timeout does not mean the provider rejected the message. The panel may already have accepted it, so failing over — or retrying the queue job — can send the same SMS twice. The default request timeout is 10 seconds and the connect timeout is 5 seconds. Keep the queue job timeout greater than timeout × number of failover drivers.
Templates
Define the template in config/smsapi.php, then send it by logical name:
Sms::otp()only delivers. You still generate the OTP code yourself.
OTP vault — issue and check a code
The code is stored as an HMAC (not plaintext), with an expiry and an attempt limit.
Queues
Laravel notifications
Tests
Supported drivers
The config key is what you set as SMSAPI_DRIVER or pass to Sms::driver('…').
SMS (Iran)
| Config | Provider |
|---|---|
smsir |
sms.ir |
kavenegar |
Kavenegar |
ghasedak |
Ghasedak |
melipayamak |
Melipayamak |
farazsms |
Farazsms |
magfa |
Magfa |
ippanel |
IPPanel |
niksms |
Niksms |
mediana |
Mediana |
limosms |
LimoSMS |
avanak |
Avanak (voice) |
amoot |
Amoot |
farapayamak |
Farapayamak |
payamito |
Payamito |
payamaknovin |
Payamaknovin |
bahmanpayam |
Bahmanpayam |
payamresan |
Payamresan |
behinpayam |
Behinpayam |
rastinsms |
Rastinsms |
Messengers
| Config | Service |
|---|---|
telegram |
Telegram |
whatsapp |
|
bale |
Bale |
eitaa |
Eitaa |
rubika |
Rubika |
gap |
Gap |
igap |
iGap |
messenger |
Facebook Messenger |
viber |
Viber |
line |
LINE |
discord |
Discord |
slack |
Slack |
Local
| Config | Use |
|---|---|
array |
In-memory driver for tests and local work |
log |
Writes to the Laravel log |
failover |
Tries several drivers and moves on when one fails |
Per-driver settings live in config/smsapi.php and the wiki.
What it covers
| Need | Supported |
|---|---|
| Simple and bulk send | Yes |
| A template id per panel | Yes |
| Failover when a panel errors | Yes |
| Several accounts or lines on one panel | Yes |
| Queues and retries | Yes |
| OTP by email | Yes |
| Issue and check OTP (vault) | Optional |
| Laravel notification channel | Yes |
| Iranian number normalization | Yes |
| Send logs | Optional |
| Delivery status (webhook) | Optional |
| Rate limiter and circuit breaker | Optional |
| HTTP API for sending | Optional |
| Messengers | Yes |
Sms::fake() in tests |
Yes |
Common settings
HTTP API and webhooks
Both are off until you install them. After that, send the token in a header (X-SMSAPI-Token or X-SMSAPI-Webhook-Token, or Authorization: Bearer). ?token= is ignored unless SMSAPI_API_ALLOW_QUERY_TOKEN / SMSAPI_WEBHOOK_ALLOW_QUERY_TOKEN=true. A webhook with no token is closed (SMSAPI_WEBHOOK_REQUIRE_TOKEN defaults to true). The send route is throttled at 60 requests per minute unless SMSAPI_API_THROTTLE is empty.
Provider API keys and bot tokens are removed from HTTP exception text before it is stored in sms_logs. The send API returns a generic error and does not echo exception text.
Static analysis: vendor/bin/phpstan analyse (Larastan, level 5, with phpstan-baseline.neon).
Docs
Full English notes are also on the GitHub wiki:
https://github.com/alizeinodin/SMSApi/wiki
- Home
- Installation
- Configuration
- Sending messages
- Templates
- OTP vault
- Queues & failover
- Notifications
- HTTP API & webhooks
- Drivers
- Adding a driver
- Testing
- Security
Changes and license
- Release notes: CHANGELOG.md
- License: MIT
All versions of smsapi with dependencies
guzzlehttp/guzzle Version ^7.5
illuminate/bus Version ^10.0|^11.0|^12.0|^13.0
illuminate/cache Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/mail Version ^10.0|^11.0|^12.0|^13.0
illuminate/notifications Version ^10.0|^11.0|^12.0|^13.0
illuminate/queue Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/view Version ^10.0|^11.0|^12.0|^13.0