跳到正文
cccskills
免费在 GitHub 公开

laravel-websocket

Use when building Laravel real-time features — Broadcasting events, ShouldBroadcast, private/presence channels, Echo client. For non-Laravel WebSockets, use the stack-native skill.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md2.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

laravel-websocket

When to use

Use when implementing real-time features — WebSockets, Broadcasting, or persistent connections.

Do NOT use when:

  • REST API endpoints (use api-design skill)
  • Reverb server setup/deployment (use laravel-reverb skill)

Procedure: Create a broadcast event

Step 0: Inspect

  1. Check config/broadcasting.php for driver (Reverb, Pusher, Ably).
  2. Check existing broadcast events — match patterns.
  3. Check routes/channels.php for channel authorization.

Step 1: Create event class

  1. Implement ShouldBroadcast.
  2. Define broadcastOn() with appropriate channel type (public/private/presence).
  3. Define broadcastAs() for event name.
  4. Define broadcastWith() — small payload (IDs + changed fields only).

Step 2: Authorize channel

Add authorization in routes/channels.php for private/presence channels.

Step 3: Client setup

Use Laravel Echo to listen on the channel. Wire up reconnection with exponential backoff.

Conventions

→ See guideline php/websocket.md for broadcasting setup, channel types, connection management, Echo.

Validate

  • Verify private/presence channels have authorization in routes/channels.php.
  • Confirm event implements ShouldBroadcast (or ShouldBroadcastNow).
  • Check that no sensitive data is broadcast on public channels.
  • Test client receives event — use browser console or Echo debug mode.

Output format

  1. Event class with broadcastOn() and channel definitions
  2. Client-side listener integration code

Gotcha

  • Connections are stateful — don't assume they persist after page navigation.
  • Always implement reconnection with exponential backoff.
  • Don't broadcast sensitive data on public channels — use private/presence.

Do NOT

  • Do NOT send entire model objects — select only needed fields.
  • Do NOT skip channel authorization for user-specific data.
  • Do NOT rely on WebSocket delivery — use acknowledgments for critical messages.

Auto-trigger keywords

  • WebSocket
  • real-time
  • broadcasting
  • Laravel Echo
  • channel authorization
  • ShouldBroadcast

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use when reviewing UI for accessibility — WCAG 2.2 AA, keyboard nav, focus, ARIA, contrast, screen-reader semantics — even on 'is this a11y-OK?' or 'mach das barrierefrei'.

中文简介正在准备中。当前显示原文说明。

event4u-app/agent-config122026年10月20日 更新

Use when defining or auditing the activation event — aha-moment selection, retention correlation, falsifiable definition. Triggers on 'what is our aha moment', 'redefine activation'.

中文简介正在准备中。当前显示原文说明。

event4u-app/agent-config122026年10月20日 更新

Use when capturing an architectural decision — file naming, next ADR number, Status / Context / Decision / Consequences, index regen; fires even without saying 'ADR'.

中文简介正在准备中。当前显示原文说明。

event4u-app/agent-config122026年10月20日 更新

Adversarial critique — devil's advocate, stress-test, honest teardown ('poke holes', 'be brutal', 'was hältst du davon'); explicit request only. Routine code or design review → code-review.

中文简介正在准备中。当前显示原文说明。

event4u-app/agent-config122026年10月20日 更新

Use when reading, creating, or updating agent documentation, module docs, roadmaps, or AGENTS.md. Understands the full .augment/, agents/, and copilot-instructions structure.

中文简介正在准备中。当前显示原文说明。

event4u-app/agent-config122026年10月20日 更新

Use for an adversarial red-team / blue-team / auditor review of an AI agent's CONFIG + behaviour (rules, skills, MCP, hooks, permissions) — attack-chain → defensive-gap list, not a code audit.

中文简介正在准备中。当前显示原文说明。

event4u-app/agent-config122026年10月20日 更新

查看 event4u-app 的全部技能

报告此技能的问题