Search by

alizne / smsapi

alizeinodin

This package is abandoned and no longer maintained. The author suggests using the alizeinodin/smsapi package instead.

Laravel SMS package for Iranian panels (sms.ir, Kavenegar, Ghasedak, …) with sandbox integration tests

Package info

github.com/alizeinodin/SMSApi

pkg:composer/alizne/smsapi

Statistics

Installs: 35

Dependents: 0

Suggesters: 0

Stars: 21

Open Issues: 0

v2.1.0 2026-10-10 11:39 UTC

README

Laravel package for Iranian SMS panels (sms.ir, Kavenegar, Ghasedak, Farazsms, IPPanel, Magfa, Niksms, …).

composer require alizeinodin/smsapi
php artisan vendor:publish --tag=smsapi-config

.env:

SMSAPI_DRIVER=smsir
SMSAPI_API_KEY=your-api-key
SMSAPI_LINE_NUMBER=30007
use Alizeinodin\SmsApi\Facades\Sms;

Sms::send('09121234567', 'سلام');
Sms::driver('kavenegar')->send('09121234567', 'سلام');
Sms::sendTemplate('09121234567', 123456, ['Code' => '12345']);

Sandbox / live panel tests

Only sms.ir documents an official Sandbox API key. Other panels use your test account credentials against the real API.

  1. Copy .env.sandbox.example → .env.sandbox and fill credentials.
  2. Unit tests (default, no network):
composer test
# or: vendor/bin/phpunit --exclude-group sandbox
  1. Live sandbox tests:
composer test:sandbox
# or: vendor/bin/phpunit --group sandbox

Missing credentials → tests are skipped, not failed.

sms.ir Sandbox

Create an API key with type Sandbox in the panel, then:

SMSAPI_API_KEY=your-sandbox-key
SMSAPI_SANDBOX_MOBILE=0912xxxxxxx

The verify call uses template 123456 and parameter Code (no real SMS / no credit).

use Alizeinodin\SmsApi\Registry\DriverRegistry;

$driver = DriverRegistry::make('smsir', [
    'api_key' => env('SMSAPI_API_KEY'),
]);

$driver->sendSandboxVerify('09121234567', '12345');

Drivers

Config key Provider
smsir sms.ir
kavenegar Kavenegar
ghasedak Ghasedak
farazsms Farazsms
ippanel IPPanel
magfa Magfa
niksms Niksms
mediana Mediana
limosms Limosms
melipayamak / farapayamak / payamito / payamaknovin / bahmanpayam / amoot Payamak-panel family
payamresan / behinpayam / rastinsms sms-webservice V3
avanak Avanak (voice)

See .env.sandbox.example for every credential key.

Messengers

Configured under the same drivers map (telegram, bale, eitaa, gap, whatsapp, …).

Driver Core send Notes
telegram / bale / eitaa / gap text Minimal bot send; Gap requires type=text
whatsapp text + templates sendTemplate($mobile, 'template_name', $vars, ['language' => 'fa'])
messenger text Override messaging_type / tag via options
slack text Optional blocks, thread_ts
discord text Optional embeds
viber / line text LINE accepts empty 200 body; optional custom messages
rubika text May time out from non-IR networks
igap experimental Default host bot.igap.net is NXDOMAIN; official iGap is protobuf/WebSocket

Foreign messengers are send-focused adapters, not full Bot SDKs (no webhooks, media upload pipelines, or conversation state).

Verification without panel accounts

Unit tests compare request shapes with official SDKs (Ghasedak, IPPanel, sms.ir, Kavenegar, LimoSMS, Mediana, Telegram, Gap, WhatsApp template, …) and check that public API hosts are reachable.

vendor/bin/phpunit --exclude-group sandbox

For Ghasedak without registration, calling accountInfo() with any key returns a structured API error (e.g. invalid apikey) — that confirms the HTTP contract is correct.

Live send confidence still needs real API keys for the panels/messengers you ship; contract + reachability alone do not prove delivery.