spitoglou / doluna-sms
通过Doluna服务API发送短信的软件包
1.0.2
2016-04-13 08:09 UTC
Requires
- php: >=5.5.9
- guzzlehttp/guzzle: ^6.1
- illuminate/support: 5.1.*
- phpunit/phpunit: 4.8.9
This package is not auto-updated.
Last update: 2024-09-20 19:09:32 UTC
README
这是一个利用Doluna SMS服务API发送短信的软件包。
要求
- PHP >=5.5.9
安装
使用Composer安装此包:(将在发布时完成)
composer require spitoglou/doluna-sms
更新composer后,将ServiceProvider添加到config/app.php中的providers数组
'providers' => [
// ...
Spitoglou\SMS\SMSServiceProvider::class,
]
使用发布命令将软件包配置复制到本地配置
php artisan vendor:publish
用法
快速(且略微有些 脏)实现的示例,直接从路由闭包中
Route::get('smsSend/{message}', function ($message) { $recipient = new \Spitoglou\SMS\SMSRecipient('306973######'); //12 digit international number here (30 stands for Greece etc.) return \Spitoglou\SMS\SMSClass::SMSSend($recipient, $message); });
配置
在app/config目录中编辑sms.php
以进行更多配置。
/* |-------------------------------------------------------------------------- | API KEY |-------------------------------------------------------------------------- | | You will need to provide here the API key that you can generate from | the Doluna site, after you have registered. | */ 'dolunaAPIKey' => 'YourApiKeyHere',
许可
Doluna-SMS遵循MIT许可证。
版权所有 2015 Stavros Pitoglou