Member-only story

Laravel and Queues

Basics

#[Pragmatic(Kiwi)]

--

The Laravel Queue

When working with a web framework like Laravel, one of the most popular PHP frameworks to date, we often have tasks such as parsing, storing, uploading which takes a long time to perform during a typical web request.

Thankfully, Laravel allows us to create queue jobs that process this in the background. This is achieved by moving the intensive task to a queue to be later processed and let or application respond with faster speed by not processing this right away.

Laravel provides a unified API across various queue backends, including Amazon SQS, Redis, Beanstalk, sync and Relational Databases.

Setup and Prerequisites

Before doing anything with the Queue we should understand the configurations and what they are doing.

config/queue.php

This may be a lot, but this is the configuration we are working on and we can break it into smaller pieces. All it does is it returns an key-value array of configurations

The default property will try to get the QUEUE_CONNECTION property from our .env file, and if there is none, it will default to…

--

--

No responses yet

Write a response