Skip to content

Commit

Permalink
Merge pull request #133 from toplan/dev
Browse files Browse the repository at this point in the history
rename files method to file
  • Loading branch information
toplan authored Jul 10, 2017
2 parents 1d8fed6 + 58632c8 commit 863918e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ Sms::voice('02343')->to($to)->send();
Sms::voice('02343')
->template('Alidayu', 'your_tts_code')
->data(['code' => '02343'])
->to($to)->send();
->to($to)
->send();
```

### 3. 在laravel和lumen中使用
Expand Down Expand Up @@ -385,7 +386,7 @@ $sms->to('1828*******');
$sms->to([86, '1828*******'])
```

### template($templates)
### template($agentName, $id)

指定代理器设置模版或批量设置,并返回实例。
```php
Expand All @@ -401,7 +402,7 @@ $sms->template([
]);
```

### data($data)
### data($key, $value)

设置模板短信的模板数据,并返回实例对象。
```php
Expand Down Expand Up @@ -431,21 +432,21 @@ $sms->content('【签名】这是短信内容...');

设置语音验证码,并返回实例对象。

### files($files)
### file($agentName, $id)

设置语音文件,并返回实例对象。
```php
$sms->files('Agent1', 'agent1_file_id')
->files('Agent2', 'agent2_file_id');
$sms->file('Agent1', 'agent1_file_id')
->file('Agent2', 'agent2_file_id');

//或
$sms->files([
$sms->file([
'Agent1' => 'agent1_file_id',
'Agent2' => 'agent2_fiile_id',
]);
```

### params($params)
### params($agentName, $params)

直接设置参数到服务商提供的原生接口上,并返回实例对象。
```php
Expand Down
4 changes: 2 additions & 2 deletions src/phpsms/Sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,14 +610,14 @@ public function code($code)
}

/**
* Set voice files.
* Set voice file.
*
* @param string|array $name
* @param string|int $id
*
* @return $this
*/
public function files($name, $id = null)
public function file($name, $id = null)
{
Util::operateArray($this->smsData['files'], $name, $id);

Expand Down

0 comments on commit 863918e

Please sign in to comment.