Trackable Jobs for Laravel is a package by Mateus Junges that allows you to track Laravel jobs in your database easily.
It works by adding the Trackable
trait to a queue job
class and stores things like job name, type, status, output, job start,
and job finish timestamps. Here's an example of what it looks like
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Junges\TrackableJobs\Traits\Trackable;
class ProcessPodcastJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, Trackable;
public function handle()
{
//
}
}
Lastly, this package enables you to track chained jobs as well. Check the readme for further details on working with chained jobs. You can learn more about this package, get full installation instructions, and view the source code on GitHub.
0 comments:
Post a Comment
Thanks