newway / turbo-sms
为 TurboSMS 服务(http://turbosms.ua/)提供的包
1.1
2015-11-27 10:49 UTC
Requires
- php: >=5.4.0
- illuminate/support: 5.1.*
This package is auto-updated.
Last update: 2024-09-16 19:05:37 UTC
README
此包仍在测试版。主要问题 - TurboSMS 的 SOAP API(实事求是地说 - 它很糟糕)。我已经联系了 TurboSMS 的支持团队 - 让我们看看他们会如何处理我的请求...
安装
在 composer.json 中要求此包
"newway/turbo-sms": "dev-master"
并将 ServiceProvider 添加到 config/app.php 中的 providers 数组中
'Newway\TurboSms\ServiceProvider',
使用 artisan CLI 发布配置(如果您想覆盖默认配置)。
php artisan vendor:publish --tag="config"
您可以在 config/app.php 文件的 aliases
键中注册 facade。
'aliases' => array( 'TurboSms' => 'Newway\TurboSms\Facade', )
包配置
return array( /* |-------------------------------------------------------------------------- | URL |-------------------------------------------------------------------------- | | URL for the SOAP API | */ 'url' => 'http://turbosms.in.ua/api/wsdl.html', /* |-------------------------------------------------------------------------- | Credentials for auth |-------------------------------------------------------------------------- */ 'auth' => [ 'login' => env('TURBO_SMS_LOGIN'), 'password' => env('TURBO_SMS_PASSWORD'), ], /* |-------------------------------------------------------------------------- | Sender name |-------------------------------------------------------------------------- */ 'sender' => env('TURBO_SMS_SENDER'), );
##使用
try { $balance = Newway\TurboSms\Facade::getBalance(); print_r($balance); $message_id = Newway\TurboSms\Facade::send('Test message', '+38099999999'); print_r($message_id); $status = Newway\TurboSms\Facade::getStatus($message_id); print_r($status); } catch (Newway\TurboSms\Exceptions\TurboSmsException $e) {}