定制 uapixart/laravel-turbosms 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

uapixart/laravel-turbosms

最新稳定版本:1.0.6

Composer 安装命令:

composer require uapixart/laravel-turbosms

包简介

Turbosms package for Laravel

README 文档

README

A package for the Laravel Framework for sending emails using the Turbosms.ua by SOAP.

Installation

The preferred way to install this extension is through composer.

Either run

composer require uapixart/laravel-turbosms

Add to config/app.php:

'providers' => array(
//...
    Uapixart\LaravelTurbosms\TurbosmsServiceProvider::class,
//...
),
'aliases' => array(
//...
    'Turbosms' => Uapixart\LaravelTurbosms\TurbosmsFacade::class,
//...
),

Then run command:

$ php artisan vendor:publish --provider="Uapixart\LaravelTurbosms\TurbosmsServiceProvider"

Basic setup

You should:

Configuration

In your config/turbosms.php, change the following

'login' => '',
'password' => '',
'sender' => '',
'options' => [],
'debug' => false,

in debug mode sms not send only add to db table. If you need proxy:

'options' => ['proxy_host' => "proxy.com", 'proxy_port' => 3128],

Usage

Send messages

Once the extension is installed, simply use it in your code by:

Turbosms::send('+380XXXXXXXXX','test');

or for multiple recipients:

Turbosms::send(['+380XXXXXXXXX','+380XXXXXXXXX'],'test');

Example for response this command:

Turbosms::send(['+9873','+3805037512XX'],'Test');
array:2 [▼
  0 => array:3 [▼
    "status" => 3
    "status_detail" => "Message undelivered: Не удалось распознать номер получателя "+9873""
    "messageid" => null
  ]
  1 => array:3 [▼
    "status" => 1
    "status_detail" => "Message send"
    "messageid" => "f7a6e2c8-5931-7dda-1d29-19c0bfec6beb"
  ]
]

Statuses:

0 - new message

1 - in queue

2 - message wait retry in queue

3 - message send

4 - message failed

Get credit balances

Get balance for user account from config

Turbosms::getBalance();

Get message status

Get status for message id

Turbosms::getMessageStatus('f7a6e2c8-5931-7dda-1d29-19c0bfec6beb');

and response:

array:1 [▼
  0 => array:2 [▼
    "status" => 4
    "status_description" => "Сообщение доставлено получателю"
  ]
]

Statuses can be next:

'0' => 'Сообщение с ID X не найдено',
'1' => 'Отправлено', *
'2' => 'В очереди', *
'3' => 'Сообщение передано в мобильную сеть', *
'4' => 'Сообщение доставлено получателю',
'5' => 'Истек срок сообщения',
'6' => 'Удалено оператором',
'7' => 'Не доставлено',
'8' => 'Сообщение доставлено на сервер', *
'9' => 'Отклонено оператором',
'10' => 'Неизвестный статус',
'11' => 'Ошибка, сообщение не отправлено',
'12' => 'Не достаточно кредитов на счете',
'13' => 'Отправка отменена',
'14' => 'Отправка приостановлена',
'15' => 'Удалено пользователем',

* - The status of the messages will change until the final status

统计信息

  • 总下载量: 25.1k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-06-02