laravel-sorna-sms maintained by mastani
Sorna SMS Laravel package
Only available for sornasms.net users
Sorna SMS laravel client
Installation in Laravel 5.5 and up
$ composer require mastani/laravel-sorna-sms
Run the command below to publish the package config file config/sornasms.php:
php artisan vendor:publish
The package will automatically register itself.
Installation in Laravel 5.4
$ composer require mastani/laravel-sorna-sms
Next up, the service provider must be registered:
// config/app.php
'providers' => [
...
mastani\SornaSMS\SornaSMSServiceProvider::class,
];
Usage
$sms = new SornaSMS();
$result = $sms->getSystemCredit(); // return Array( [success] => 1 [result] => 105000 )
$result = $sms->sendSMS('mobile number', 'message'); // return Array( [success] => 1 [result] => 8830401037900810478 )
Function
| Function | Description |
|---|---|
| getSystemCredit() | Get account credit. |
| sendSMS(mobile, message) | Send single SMS. |
| sendSMS([mobiles], [messages]) | Send multiple SMS. |
| sendSMS021(mobile, message) | Send single SMS with 021 line (if you owned one). |
| sendSMS021([mobiles], [messages]) | Send multiple SMS with 021 line (if you owned one). |
| sendSMSBlacklist(mobile, message) | Send single SMS with blacklist module. |
| sendSMSBlacklist([mobiles], [messages]) | Send multiple SMS with blacklist module. |
Error messages
| Error | Description |
|---|---|
| -99 | اتمام زمان مجاز جهت ارسال پیامک |
| -100 | Reference id مورد نظر یافت نشد. |
| -101 | احراز کاربر موفقیت آمیز نبود. |
| -102 | نام کاربری یافت نشد. |
| -103 | شماره کاربری اشتباه یا در بین بازه شماره های کاربر نیست. |
| -104 | اعتبار کاربر کم است. |
| -105 | فرمت درخواست اشتباه است. |
| -106 | تعداد Reference id ها بیش از 1000 عدد است. |
| -107 | شماره گیرنده پیام اشتباه است. |
| -108 | شماره گیرنده پیام اشتباه است. |
| -98 | شماره گیرنده در لیست سیاه مخابرات قرار دارد. |
| -111 | شماره گیرنده در لیست سیاه مخابرات قرار دارد. |
| -112 | شماره لیست سیاه یافت نشد. |
| -115 | برنامه ارسالی در حال اجرا میباشد. امکان ارسال همزمان وجود ندارد. |
License
The MIT License (MIT). Please see License File for more information.