一键导入
laravel-jobs
Background jobs and event listeners for async processing. Use when creating or modifying jobs, queues, listeners, or event-driven workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Background jobs and event listeners for async processing. Use when creating or modifying jobs, queues, listeners, or event-driven workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
High-level architecture decisions, patterns, and project structure. Use when deciding which pattern to use, organizing code, or making structural decisions.
Package development and extraction of reusable code. Use when creating, extracting, or modifying composer packages.
Service providers, bootstrapping, and application configuration. Use when modifying service providers, booters, bootstrap logic, or app-level configuration.
Code quality tooling with PHPStan, Pint, and strict types. Use when configuring or running static analysis, code style, or linting.
Route configuration, route model binding, and authorization. Use when defining routes, configuring model binding, or setting up route-level authorization.
Comprehensive testing patterns with Pest. Use when writing or modifying tests, mocking, factories, or test patterns.
| name | laravel-jobs |
| description | Background jobs and event listeners for async processing. Use when creating or modifying jobs, queues, listeners, or event-driven workflows. |
Background jobs and event listeners: thin delegation layers to actions.
jobs-listeners.md - Job patterns:
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.