Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Interesting Laravel Packages / Addons

Quite often I will see an interesting add-on/package for Laravel in my feed, but I only have so much time in the world to research and document these things. Hence, here is a list, so I don't forget about them and can quickly find them when I do have some spare time.

1. Laravel Haystack

This is a package that allows you to have a job chain stored in the database.

Example code:

$haystack = Haystack::build()
   ->addJob(new RecordPodcast)
   ->addJob(new ProcessPodcast)
   ->addJob(new PublishPodcast)
   ->then(function () {
      // Haystack completed
   })
   ->catch(function () {
      // Haystack failed
   })
   ->finally(function () {
      // Always run either on success or fail.
   })
   ->paused(function () {
      // Run if the haystack is paused
   })
   ->withMiddleware([
      // Middleware to apply on every job
   ])
   ->withDelay(60) // Add a delay to every job
   ->dispatch();
Last updated: 9th August 2022
First published: 9th August 2022

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch