Download the PHP package abolfazlrastegar/laravel-sms without Composer
On this page you can find all versions of the php package abolfazlrastegar/laravel-sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download abolfazlrastegar/laravel-sms
More information about abolfazlrastegar/laravel-sms
Files in abolfazlrastegar/laravel-sms
Package laravel-sms
Short Description package multi sms for Laravel
License MIT
Informations about the package laravel-sms
Laravel SMS
A Laravel package with a common API for Kavenegar, SMS.ir and Melipayamak.
Requirements
- PHP 7.4+ (the host application's PHP version must also satisfy the selected Laravel release)
- Laravel 8, 9, 10, 11, 12 and 13
Laravel's minimum PHP versions vary by major release: Laravel 8 supports PHP 7.4; Laravel 9 requires PHP 8.0.2+; Laravel 10 requires PHP 8.1+; Laravel 11 and 12 require PHP 8.2+; Laravel 13 requires PHP 8.3+.
Installation
Configuration
Set credentials in .env; never commit provider keys.
Sending mode is controlled explicitly with SMS_MODE. The default is sync, so installing the package does not change the application's existing behavior. No application-level Job class is required.
SMS_MODE=sync: sends immediately and returns the provider response.SMS_MODE=queue: dispatches the package's internalSendSmsJobusing Laravel'squeue.defaultconnection (for exampledatabaseorredis).- The queue name defaults to
smsand can be changed withSMS_QUEUE. - Attempts and timeout are configurable with
SMS_QUEUE_TRIESandSMS_QUEUE_TIMEOUT.
Delivery logs
The package can persist send lifecycle records in the sms_logs table for both sync and queue modes. Logging is enabled by default and can be disabled with SMS_LOG_ENABLED=false. Publish the package migration and run php artisan migrate to create the table. If the migration has not been run, logging safely becomes a no-op and does not interrupt SMS sending.
The log stores the driver, operation, masked recipient number(s), lifecycle status, provider message ID/response code when available, attempt count, duration, and error message. Message bodies, templates, parameters, and provider credentials are never intentionally stored. Keep in mind that exception text comes from HTTP/provider libraries; do not expose raw log records publicly.
Statuses include queued, processing, retrying, sent, and failed. The metadata JSON column is reserved for safe, non-sensitive additional context.
Configure the queue connection in the host Laravel application as usual and run its queue worker, for example:
For the database queue driver, the host application must also have Laravel's standard queue table migration installed. The package does not create or modify Laravel's queue tables.
After changing environment values in production, clear/rebuild Laravel's config cache.
Usage
Send a regular SMS:
Group send requires matching recipient/message counts. Kavenegar additionally requires a sender array with the same number of entries.
Voice calls are supported by Kavenegar only. Unsupported driver capabilities throw UnsupportedFeatureException.
Driver notes
- Kavenegar uses its GET API with query parameters; Laravel encodes values safely.
- SMS.ir uses the
X-API-KEYheader and JSON request bodies. - Melipayamak uses its REST SendSMS and BaseServiceNumber endpoints. For verification, pass the text template in
params(['text' => '...'])and the provider body ID astemplate(). - Queue workers retry failed jobs according to the configured attempt count. Be aware that retrying after a provider timeout can produce duplicate SMS messages.
- A successful API response means the provider accepted the request; it does not prove delivery to the handset.
Testing
Tests use Laravel's HTTP fake and never send real SMS messages.