Skip to content

[13.x] Add multi-queue support to queue:clear command#60873

Merged
taylorotwell merged 2 commits into
laravel:13.xfrom
miladshakerdn:feature/queue-clear-multiple-queues
Jul 24, 2026
Merged

[13.x] Add multi-queue support to queue:clear command#60873
taylorotwell merged 2 commits into
laravel:13.xfrom
miladshakerdn:feature/queue-clear-multiple-queues

Conversation

@miladshakerdn

Copy link
Copy Markdown
Contributor

Description

This PR adds support for comma-separated queue names to the queue:clear Artisan command, making it consistent with other queue commands such as queue:work and queue:listen.

Currently, queue:clear only accepts a single queue name via --queue. With this change, developers can clear multiple queues in a single execution:

php artisan queue:clear redis --queue=high,low,emails

Changes

  • Updated Illuminate\Queue\Console\ClearCommand to parse, trim, filter empty values, and deduplicate comma-separated queue names using the Collection pipeline.
  • Maintained output formatting consistency using standard Laravel Stringable helpers.
  • Created unit test suite in tests/Queue/QueueClearCommandTest.php covering:
  • Default single queue execution.
  • Multiple comma-separated queues.
  • Whitespace trimming (--queue="high, low").
  • Empty value filtering (--queue="high,,low").
  • Queue deduplication (--queue="high,low,high").

Backward Compatibility

Fully backward-compatible. Passing a single queue name behaves exactly as before.

Comment thread src/Illuminate/Queue/Console/ClearCommand.php Outdated
@taylorotwell
taylorotwell merged commit 7c8a5c3 into laravel:13.x Jul 24, 2026
53 checks passed
@miladshakerdn
miladshakerdn deleted the feature/queue-clear-multiple-queues branch July 24, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants