Home / Tutorials / Deleting Laravel Redis Queue Jobs
Deleting Laravel Redis Queue Jobs cover

Deleting Laravel Redis Queue Jobs

Learn how Laravel redis queue jobs can be deleted

5 mins

4.7K

3 years ago

0 comments

Beginner

There are several ways to delete Laravel Redis queue jobs and below are the available options.

Option 1 - Laravel Command

The first way to clear a Redis queue is to use the artisan queue clear:command and this is the easiest you can do. Just open up the terminal and type the command below.
php artisan queue:clear [connection] [queue]
This command also works with other queue types such as a database.

Option 2 - Redis CLI

The second way is to use the Redis command and you can access it by typing it below.
redis-cli
once you are in Redis CLI, just run the command below.
FLUSHDB
This will clear all of your Redis cached.

Option 3 - Laravel Facade

Thirdly, If you want to use Laravel facade then you can create a route closure or console command to run the Redis command.
use Redis;

Redis::command('flushdb');
BONUS: If you want then you can make use of Laravel tinker.
php artisan tinker
After that run the command the flushdb command by passing it to the method parameters.
\\Redis::command(‘flushdb’);
Above are some of the ways to clear out your Redis cache, there are other ways but those 3 ways above is the most common one and proven tested.

Thank you for reading the tutorial and I hope you managed to learn something. Do comment below to start the discussion of this topic. Cheers 🍻
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this