poldixd / laravel-queue-clear-all
Development-only Artisan command to clear all Laravel Horizon queues.
Package info
github.com/poldixd/laravel-queue-clear-all
pkg:composer/poldixd/laravel-queue-clear-all
Requires
- php: ^8.2
- illuminate/support: ^11.0 || ^12.0 || ^13.0
- laravel/horizon: ^3.0 || ^4.0 || ^5.0
Requires (Dev)
- laravel/pint: ^1.19
- orchestra/testbench: ^9.0 || ^10.0 || ^11.0
- pestphp/pest: ^3.0 || ^4.0
- pestphp/pest-plugin-laravel: ^3.0 || ^4.0
README
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