November 25th, 2025

When queue:failed isn't enough: building a better failed jobs CLI

When queue:failed isn't enough: building a better failed jobs CLI

If you've ever managed Laravel queues in production, you know the drill. A job fails, you run php artisan queue:failed, and you're greeted with a wall of text that's nearly impossible to parse when you have hundreds of failed jobs staring back at you.

I've been there countless times. Scrolling through endless output, trying to find that one SendEmailJob that failed yesterday, or wondering how many jobs failed on the notifications queue this week. The native command works, but it wasn't built for the complexity of modern production environments.

So I built something better.

Introducing Laravel Enhanced Failed Jobs

The package extends Laravel's native queue:failed command with features that should have been there from the start: JSON output, advanced filtering, and the ability to actually find what you're looking for.

1composer require mvpopuk/laravel-enhanced-failed-jobs

That's it. No configuration needed. The package auto-registers and enhances your existing queue:failed command.

Filtering That Actually Works

Need to see only email-related failures from the last 24 hours?

1php artisan queue:failed --queue=emails --after=yesterday

Looking for a specific job class? Partial matching has you covered:

1php artisan queue:failed --class=SendEmail

You can combine filters however you need:

1php artisan queue:failed --queue=critical --connection=redis --after="2025-11-20" --limit=50

JSON Output

This is where things get interesting. The --json flag transforms the output into structured data that your automation tools can actually consume:

1php artisan queue:failed --json

Suddenly, your failed jobs become queryable with jq, parseable by your monitoring scripts, and integrable with your deployment pipelines.

Here's a practical example—failing a deployment if critical jobs have failed:

1FAILED_COUNT=$(php artisan queue:failed --queue=critical --json | jq '.count')
2if [ "$FAILED_COUNT" -gt 0 ]; then
3 echo "Deployment blocked: $FAILED_COUNT critical jobs failed"
4 exit 1
5fi

No more silent failures slipping through your CI/CD pipeline.

What's Next: QueueWatch

I'm currently working on QueueWatch which is an optional dashboard that provides real-time failure reporting, multi-app monitoring, and alerts through Slack, Discord, and more. The CLI tools will always remain free and open source, with QueueWatch as an optional add-on for teams that need centralized monitoring.

Get Started

The package is available now on GitHub and Packagist:

1composer require mvpopuk/laravel-enhanced-failed-jobs

Check out the repository at github.com/mvpopuk/laravel-enhanced-failed-jobs and let me know what features you'd like to see next.

Statamic Ninja

Comments

Marian Pop

PHP / Laravel Developer. Writing and maintaining @LaravelMagazine. Host of "The Laravel Magazine Podcast". Pronouns: vi/vim.

Subscribe to our newsletter

Get latest news, tutorials, community articles and podcast episodes delivered to your inbox.

Weekly articles
We send a new issue of the newsletter every week on Friday.
No spam
We'll never share your email address and you can opt out at any time.