Implement background jobs with queues, workers, batches, chains, middleware, and failure handling. Use when processing async tasks or handling long-running operations.
View on GitHubFebruary 2, 2026
Select agents to install to:
npx add-skill https://github.com/fusengine/agents/blob/main/plugins/laravel-expert/skills/laravel-queues/SKILL.md -a claude-code --skill laravel-queuesInstallation paths:
.claude/skills/laravel-queues/# Laravel Queues ## Agent Workflow (MANDATORY) Before ANY implementation, launch in parallel: 1. **fuse-ai-pilot:explore-codebase** - Analyze existing job patterns 2. **fuse-ai-pilot:research-expert** - Verify Queue docs via Context7 3. **mcp__context7__query-docs** - Check job and worker patterns After implementation, run **fuse-ai-pilot:sniper** for validation. --- ## Overview | Component | Purpose | |-----------|---------| | **Jobs** | Background tasks with retries, timeouts | | **Workers** | Process jobs from queues | | **Batches** | Group jobs with progress tracking | | **Chains** | Sequential job execution | | **Middleware** | Rate limiting, deduplication | | **Horizon** | Redis queue monitoring dashboard | --- ## Decision Guide: Queue Driver ``` Which driver? ├── Development → sync (instant execution) ├── Small app → database (simple, no Redis) ├── Production → redis (fast, Horizon support) ├── AWS → sqs (managed, scalable) └── High volume → redis + Horizon (monitoring) ``` --- ## Decision Guide: Job Design ``` Job type? ├── Simple async → Standard Job ├── Group processing → Batch (progress, cancel) ├── Sequential steps → Chain (A → B → C) ├── Rate limited → Middleware + RateLimiter ├── Unique execution → UniqueJob / WithoutOverlapping └── Long running → Timeout + Retry settings ``` --- ## Critical Rules 1. **Use ShouldQueue** for async processing 2. **Set tries and backoff** for resilience 3. **Implement failed()** method for error handling 4. **Use database transactions** carefully with jobs 5. **Monitor with Horizon** in production --- ## Reference Guide ### Concepts | Topic | Reference | When to Consult | |-------|-----------|-----------------| | **Jobs** | [jobs.md](references/jobs.md) | Creating job classes | | **Dispatching** | [dispatching.md](references/dispatching.md) | Sending jobs to queues | | **Workers** | [workers.md](references/workers.md) | Running queue workers | | **Batching** | [batching.md](references/batching.md) | Gr