Skip to content

Commit

Permalink
Merge pull request #61 from toplan/dev
Browse files Browse the repository at this point in the history
default close sms send queue
  • Loading branch information
toplan committed Mar 24, 2016
2 parents 8b09fa6 + 1f74125 commit 801d407
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ phpsms为laravel-sms提供了全套的短信发送机制,而且phpsms也有自
在项目根目录下运行如下composer命令:
```php
//安装2.2版本(推荐)
composer require 'toplan/laravel-sms:~2.2.6',
composer require 'toplan/laravel-sms:~2.2.7',

//安装开发中版本
composer require 'toplan/laravel-sms:dev-master'
Expand Down Expand Up @@ -141,7 +141,7 @@ phpsms为laravel-sms提供了全套的短信发送机制,而且phpsms也有自

###1. 启用/关闭队列

判断当前队列状态:
`laravel-sms`已实现的短信队列默认是关闭的,判断当前队列状态:
```php
$enable = PhpSms::queue();//return true of false
```
Expand Down Expand Up @@ -170,14 +170,14 @@ php artisan queue:listen

* 方式2:自定义队列流程

在发送短信前,你可以重新定义你的队列流程哦
在发送短信前,你可以完全重新定义你的队列流程哦

```php
//example:
PhpSms::queue(function($sms, $data){
...
//假设如此推入队列:
$this->dispatch(new yourQueueJobClass($sms));
$this->dispatch(new YourQueueJobClass($sms));
...
//请务必返回如下数据用以标记推入队列成功(否则会报错):
return [
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "toplan/laravel-sms",
"description": "sms send package for laravel",
"license": "MIT",
"version": "2.2.6",
"version": "2.2.7",
"keywords": ["sms", "laravel sms", "laravel-sms"],
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/Toplan/LaravelSms/SmsManagerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function initPhpSms()

// define how to use queue
$queueJob = config('laravel-sms.queueJob', 'App\Jobs\SendReminderSms');
Sms::queue(function ($sms, $data) use ($queueJob) {
Sms::queue(false, function ($sms, $data) use ($queueJob) {
if (!class_exists($queueJob)) {
throw new LaravelSmsException("Class [$queueJob] does not exists.");
}
Expand Down

0 comments on commit 801d407

Please sign in to comment.