# Laravel Reverb Websockets

> Use when setting up, configuring, or debugging real-time broadcasting and websockets using Laravel Reverb and Echo.

- **Type:** Skill
- **Install:** `agentstack add skill-alizharb-agent-skills-laravel-reverb-websockets`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [AlizHarb](https://agentstack.voostack.com/s/alizharb)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [AlizHarb](https://github.com/AlizHarb)
- **Source:** https://github.com/AlizHarb/agent-skills/tree/main/resources/boost/skills/laravel-reverb-websockets

## Install

```sh
agentstack add skill-alizharb-agent-skills-laravel-reverb-websockets
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Laravel Reverb Websockets

## When To Use

Use this skill when implementing real-time updates, chat systems, live notifications, or dashboard stat updates using Laravel Reverb and Laravel Echo.

## Workflow

1. **Verify installation**: Ensure Reverb configuration exists (`config/reverb.php`).
2. **Channel definition**: Specify broadcast channels and authorized access rules inside `routes/channels.php`.
3. **Configure the Event**: Ensure event implements `ShouldBroadcast` or `ShouldBroadcastNow`.
4. **Trigger Event**: Broadcast the event safely via standard event dispatches.
5. **Echo Client Integration**: Setup frontend Echo client listener bindings for private/presence channels.

## Examples

### Good Example

```php
// app/Events/MessageSent.php
namespace App\Events;

use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\PrivateChannel;

final class MessageSent implements ShouldBroadcast
{
    use Dispatchable, SerializesModels;

    public function __construct(public string $message, public int $userId) {}

    public function broadcastOn(): array
    {
        return [
            new PrivateChannel("chat.user.{$this->userId}"),
        ];
    }
}
```

```php
// routes/channels.php
Broadcast::channel('chat.user.{id}', function (User $user, int $id) {
    return $user->id === $id;
});
```

### Bad Example

```php
// ❌ Using public broadcast channels for sensitive data, or using custom HTTP calls for real-time updates.
public function triggerUpdate(Request $request) {
    Http::post('http://localhost:3000/trigger', $request->all());
}
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [AlizHarb](https://github.com/AlizHarb)
- **Source:** [AlizHarb/agent-skills](https://github.com/AlizHarb/agent-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-alizharb-agent-skills-laravel-reverb-websockets
- Seller: https://agentstack.voostack.com/s/alizharb
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
