SetStartStatus(); //Get all of the contacts from the rentals group $contacts = MoonRental::select('Contact')->groupBy('Contact')->get(); foreach($contacts as $contact) { MoonRentalInvoiceCreate::dispatch($contact, $delay)->onQueue('moons'); //Increase the delay after each job to prevent mails from backing up later down the queue $delay += 20; } //Set the job as completed $task->SetStopStatus(); } }