Appending & Prepending Jobs
<?php
namespace App\Jobs;
use Sammyjo20\LaravelHaystack\Contracts\StackableJob;
use Sammyjo20\LaravelHaystack\Concerns\Stackable;
class ProcessPodcast implements ShouldQueue, StackableJob
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, Stackable
public function handle()
{
// Append a job to the end of the haystack
$this->appendToHaystack(new DifferentJob);
// Append a job and put it right at the top of the haystack
$this->prependToHaystack(new NextJob);
}Last updated