$ recombobulate _
home / tips / generate-laravel-queued-jobs-and-workers-with-claude
0

Generate Laravel Queued Jobs and Workers with Claude

bagwaa @bagwaa · Mar 26, 2026 · Workflows
generate-laravel-queued-jobs-and-workers-with-claude

Queue workers are boilerplate-heavy — describe what your job should do and Claude writes the full class, retry logic, and test suite in one shot.

"Write a Laravel queued job that processes a video upload:
- Accept a Video model ID
- Download from S3, transcode with FFmpeg, save a thumbnail
- Retry 3 times with exponential backoff on failure
- Dispatch a VideoProcessed event when done
Add Pest tests for success, failure, and retry behaviour."

Queue jobs involve a lot of moving parts: the job class, handle() logic, failed() method, retry configuration, and dispatching from controllers. Claude handles the boilerplate so you can focus on the actual processing logic.

The generated job includes proper dependency injection, ShouldQueue, and the right $tries and $backoff properties:

class ProcessVideoUpload implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public int $tries = 3;
    public array $backoff = [30, 60, 120];

    public function __construct(public readonly int $videoId) {}
}

The test suite fakes the queue with Queue::fake(), asserts dispatch happens with the right payload, and simulates the failed() path — so you know retry behaviour is correct before it hits production.

Add your queue driver and worker config to CLAUDE.md so Claude knows whether you're on Redis, SQS, or the database driver without asking every time.

Queue workers don't have to be a chore — describe the side effect you want and Claude ships the class.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 2 hours ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 2 hours ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago