skills/laravel/laravel-background-processing/SKILL.md
Build scalable asynchronous workflows using Queues, Jobs, and Events in Laravel. Use when implementing queued jobs, event-driven workflows, or async processing in Laravel.
npx skillsauth add hoangnguyen0403/agent-skills-standard laravel-background-processingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
app/
├── Jobs/ # Asynchronous tasks
├── Events/ # Communication flags
└── Listeners/ # Task reactions
php artisan make:job ProcessOrder. Classes must implement ShouldQueue.handle() method. Pass only model IDs to constructor, not full Eloquent model.ProcessOrder::dispatch($orderId).Bus::chain([new ProcessPayment($order), new SendReceipt($order)])->dispatch() for sequential dependencies. Handle failures with ->catch(fn => ...).Bus::batch([new ImportRow(1), ...])->then(...)->catch(...)->dispatch(). Use $this->batch()->cancel() to abort and track via $batch->progress().php artisan make:event OrderPlaced and php artisan make:listener SendConfirmation --event=OrderPlaced.ShouldQueue to listeners to process them asynchronously.Event::dispatch(new OrderPlaced($order)).public function failed(Throwable $exception) in your job class. Use public int $tries = 3 and public int $backoff = 60 for retries.queue:failed-table migration to track dead jobs.php artisan horizon) for real-time observability; never use queue:work in production.testing
Infer the requesting operator's technical fluency from message content (never ask directly) and adapt register — business, hybrid, or technical — across SDLC workflow output. Use when starting sdlc, brainstorm-feature, plan-feature, verify-work, publish-notes, or session-report, or whenever a request's phrasing signals a non-technical or cross-stack operator.
documentation
Define transaction boundaries, locking, and consistency guarantees for multi-step writes. Use when designing atomic operations, retries, idempotency, or concurrent write behavior.
development
Design relational or document schemas from access patterns, cardinality, and lifecycle. Use when modeling entities, choosing embed vs normalize, or shaping schema boundaries before implementation.
data-ai
Diagnose database latency with explain plans, index ownership, and query-shape review. Use when a query is slow, an index is missing, or scans and N+1 patterns appear.