|
...
|
...
|
@@ -46,9 +46,61 @@ composer require lackoxygen/exception-push |
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
# 使用方法
|
|
|
|
# 配置发布
|
|
|
|
|
|
|
|
```php
|
|
|
|
php artisan vendor:publish --provider=Lackoxygen\\ExceptionPush\\ExceptionPushProvider
|
|
|
|
```
|
|
|
|
|
|
|
|
# 同步
|
|
|
|
|
|
|
|
```
|
|
|
|
none
|
|
|
|
```
|
|
|
|
|
|
|
|
# 异步
|
|
|
|
|
|
|
|
```php
|
|
|
|
namespace App\Jobs;
|
|
|
|
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Lackoxygen\ExceptionPush\Dispatcher;
|
|
|
|
|
|
|
|
class Send implements ShouldQueue
|
|
|
|
{
|
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new job instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct($agents, $body)
|
|
|
|
{
|
|
|
|
$this->agents = $agents;
|
|
|
|
|
|
|
|
$this->body = $body;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the job.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
$dis = new Dispatcher();
|
|
|
|
$func = $dis->default();
|
|
|
|
|
|
|
|
$func($this->agents, $this->body);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
...
|
...
|
|