soroosh/laravel-bus

此包的最新版本(0.1.1)没有可用的许可信息。

增强laravel illuminate\bus

0.1.1 2023-01-05 14:56 UTC

This package is auto-updated.

Last update: 2024-09-05 18:41:26 UTC


README

Test

Laravel Bus

增强laravel Illuminate\Bus。

  • 任务调度失败时记录日志

如何使用

创建一个新的任务

  php artisan laravel-bus:make-job DummyJob 

或者只需在现有的任务中扩展Soroosh\LaravelBus\Job\DispatchableShouldQueue

<?php
namespace App\Jobs;

use Soroosh\LaravelBus\Job\DispatchableShouldQueue;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;

class MockJob extends DispatchableShouldQueue
{
    use InteractsWithQueue;
    use Queueable;
    use SerializesModels;

    public function handle()
    {
        Log::info("Hello from MockJob");
    }
}