scaffold-listener

📁 iurygdeoliveira/labsis-kit 📅 Jan 24, 2026
3
总安装量
3
周安装量
#58495
全站排名
安装命令
npx skills add https://github.com/iurygdeoliveira/labsis-kit --skill scaffold-listener

Agent 安装分布

claude-code 2
windsurf 1
trae 1
opencode 1
codex 1
antigravity 1

Skill 文档

Laravel Listener Pattern Skill

Use this skill when implementing Event-Driven Architecture.

Workflow

  1. Create Event: php artisan make:event [EventName]
  2. Create Listener: php artisan make:listener [ListenerName] --event=[EventName]

Rules

1. Queued Listeners

  • If the listener performs IO (Email, API, Notification), it MUST implement ShouldQueue.
class SendWelcomeEmail implements ShouldQueue
{
    // ...
}

2. Dependency Injection

  • Inject dependencies in __construct.
  • Access event data in handle(EventName $event).

3. Verification

  • Ensure the mapping exists. Laravel 11/12 detects it automatically if the listener type-hints the event.