计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
laravel-background-processing【效率与协作】Build scalable asynchronous workflows using Queues, Jobs, and Events in Laravel. Use when implementing queued jobs, event-driven workflows, or async processing in Laravel.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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.config/horizon.php, then run php artisan horizon; do not use queue:work as the production monitor.When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:
composer
batch()->cancel
Additional task-grounded exact anchors: ImportRow