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
1<?php 2 3namespace App\Jobs; 4 5use Illuminate\Bus\Queueable; 6use Illuminate\Contracts\Queue\ShouldQueue; 7use Illuminate\Foundation\Bus\Dispatchable; 8use Illuminate\Queue\InteractsWithQueue; 9use Illuminate\Queue\SerializesModels;10use Junges\TrackableJobs\Traits\Trackable;11 12class ProcessPodcastJob implements ShouldQueue13{14 use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, Trackable;15 16 public function handle()17 {18 //19 }20}
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