# Laravel Jobs

> Background jobs and event listeners for async processing. Use when creating or modifying jobs, queues, listeners, or event-driven workflows.

- Skill: `leeovery/laravel-jobs` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add leeovery/laravel-jobs`
- Raw SKILL.md: https://api.skillmd.com/api/skills/leeovery/laravel-jobs/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: leeovery (https://skillmd.com/u/leeovery)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/leeovery/laravel-jobs

---


# Laravel Jobs

Background jobs and event listeners: thin delegation layers to actions.

## Core Concept

**[jobs-listeners.md](references/jobs-listeners.md)** - Job patterns:
- Jobs as thin delegation layers
- Queue configuration
- Retry logic and timeouts
- Unique jobs
- Job middleware
- Event listeners
- When to use jobs vs sync actions

## Pattern

```php
final class ProcessOrderJob implements ShouldQueue
{
    use Dispatchable, Queueable;

    public function __construct(
        public readonly int $orderId,
    ) {}

    public function handle(ProcessOrderAction $action): void
    {
        $order = Order::findOrFail($this->orderId);

        $action($order);
    }

    public function middleware(): array
    {
        return [new WithoutOverlapping($this->orderId)];
    }
}

// Listener
final class SendOrderConfirmationListener
{
    public function handle(OrderPlaced $event): void
    {
        SendOrderConfirmationJob::dispatch($event->order->id);
    }
}
```

Jobs delegate to actions. Keep domain logic in actions, not jobs.

