The ease of being able to queue jobs in Laravel is one of my favourite features of the framework. All you have to do is implement the ShouldQueue interface and the job will automatically be placed onto the queue. It’s so easy!

However, if you are like me and you use AWS, one drawback of the SQS provider is it’s not so easy to accept the jobs from the queue and process them.

Ideally we could just call the marshall() method on the Queue facade from the Controller that accepts the job.

In today’s tutorial we’ll be looking at what you need to build to add this functionality to your Laravel application.

What will the end product look like?

If you are not familiar with the marshall() method, the introduction of this article might be a bit abstract.

When a job is dispatched from SQS to the application, we need to accept it through a Controller and then run the job.

This involves a little bit of jiggery-pokery and so we can hide this behind a simple method call.

The final product of this tutorial will allow your Controller method to look like this: