---
name: "laravel-11-reverb-websockets"
description: "Deploy native, real-time WebSocket broadcasting in Laravel 11 using first-party Laravel Reverb."
metadata:
  author: "Laravel"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "install laravel reverb"
  - "laravel shouldbroadcast event"
  - "laravel echo reverb connect"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Laravel 11 Reverb High-Performance WebSocket Server

Configures Laravel 11 Reverb: installing reverb, defining ShouldBroadcast events, channel authorization routes (routes/channels.php), private and presence channels, and connecting frontend clients with Laravel Echo.

## When to Invoke
Invoke this skill whenever you need to:
- install laravel reverb
- laravel shouldbroadcast event
- laravel echo reverb connect

## Execution SOP & Rules
1. Install Reverb: php artisan install:broadcasting and choose Reverb.
2. Start Reverb server: php artisan reverb:start.
3. Authorize private channel in routes/channels.php: Broadcast::channel('orders.{id}', fn($user, $id) => ...);
4. Broadcast event: event(new OrderShipped($order)); and listen in Echo: Echo.private(`orders.${id}`).listen(...).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
