andrewboy / laravel-see-me
此包的最新版本(1.0.1)没有提供许可证信息。
Laravel包用于SeeMe短信发送器。
1.0.1
2017-05-24 14:19 UTC
Requires
- php: >=5.5.9
- andrewboy/see-me: 1.0.*
- illuminate/support: >5.0
Requires (Dev)
- fabpot/php-cs-fixer: ^1.10
- laravel/laravel: 5.1.*
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-09-15 02:48:17 UTC
README
此包是laravel(5.1-5.4)对SeeMe的包装。它可以在方法参数中自动加载。使用LoggerInterface。
设置
安装
composer require andrewboy/laravel-see-me
app.php
'providers' => [ ... \Andrewboy\LaravelSeeMe\LaravelSeeMeServiceProvider::class, ]
发布(可选)
php artisan vendor:publish
配置(seeme.php)
return [ 'format' => \Andrewboy\SeeMe\SeeMeGateway::FORMAT_JSON, 'method' => \Andrewboy\SeeMe\SeeMeGateway::METHOD_CURL, 'log_to_file' => true ];
-
格式
- 类型:字符串
- 必需:否
- 默认:'json'
-
方法
- 类型:字符串
- 必需:否
- 默认:'curl'
-
log_to_file
- 类型:布尔型
- 必需:否
- 默认:false
SeeMe类
格式类型
- 'json'
- 'string'
- 'xml'
方法类型
- 'curl'
- 'file_get_contents'
方法
__consrtuct
参数
-
$apiKey: 应用程序密钥
- 类型:字符串
- 必需:是
-
$logFileDestination: 如果为false,则忽略日志
- 类型:布尔型
- 必需:否
- 默认:false
-
$format: 结果格式
- 类型:字符串
- 必需:否
- 默认:'json'
-
$method: 设置方法类型
- 类型:字符串
- 必需:否
- 默认:'curl'
返回值
- void
setLogger
参数
- $logger
- 类型:LoggerInterface
- 必需:是
返回值
- $this
setApiKey
参数
- $apiKey: 应用程序密钥
- 类型:字符串
- 必需:是
返回值
- void
setMethod
参数
- $method: 设置方法类型
- 类型:字符串
- 必需:是
返回值
- void
setFormat
参数
- $format: 设置结果格式
- 类型:字符串
- 必需:是
返回值
- void
setIP
参数
- $ip
- 类型:字符串
- 必需:是
返回值
- 数组
sendSMS
参数
-
$number: 手机号码,格式:/^36(20|30|31|70)\d{7}$/
- 类型:字符串
- 必需:是
-
$message: 短信消息
- 类型:字符串
- 必需:是
-
$sender: 发送者ID(手机号码)
- 类型:字符串|null
- 必需:否
- 默认:null(在SeeMe管理面板中使用的号码)
-
$reference
- 类型:字符串|null
- 必需:否
- 默认:null
-
$callbackParams
- 类型:字符串|null
- 必需:否
- 默认:null
-
$callbackURL
- 类型:字符串|null
- 必需:否
- 默认:null
返回值
- 数组
getResult
返回值
- 数组
getBalance
返回值
- 数组
getLog
返回值
- 类型:字符串