Looking to hire Laravel developers? Try LaraJobs

laravel-queue-clear-all maintained by poldixd

Description
Development-only Artisan command to clear all Laravel Horizon queues.
Author
Last update
2026/05/06 17:32 (dev-main)
License
Downloads
15

Comments
comments powered by Disqus

Laravel Queue Clear All

Clear all queues configured in Laravel Horizon with a single Artisan command.

This package is intended for local development and non-production environments. Do not install or run it in production.

The package reads the queue names from config('horizon.environments'), removes duplicates, and runs Laravel's built-in queue:clear command for each queue.

Installation

Install the package with Composer:

composer require --dev poldixd/laravel-queue-clear-all

Laravel package auto-discovery registers the service provider automatically.

Usage

Clear every queue configured in Horizon using your default queue connection:

php artisan queue:clear-all

By default, the command uses config('queue.default') as the queue connection.

You can also pass a connection explicitly:

php artisan queue:clear-all redis

For every unique queue name found in your Horizon configuration, the package calls:

php artisan queue:clear CONNECTION --queue=QUEUE

For example, if Horizon contains the queues default, emails, and notifications, this package clears each of them once.

Horizon Configuration

The command supports Horizon queue definitions as strings or arrays:

'environments' => [
    'production' => [
        'supervisor-1' => [
            'connection' => 'redis',
            'queue' => ['default', 'emails'],
        ],
        'supervisor-2' => [
            'connection' => 'redis',
            'queue' => 'notifications',
        ],
    ],
],

Testing

Run the test suite with:

composer test