Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

LvckyAPI's avatar

Reverb is not receiving event

I am trying to build a real-time chat. So I need reverb to send the messages to everyone live without reloading the page.

Problem is, that the MessageCreatedEvent was not received by reverb. Only th pusher ping is in the log. The queue is working and is dispatching the event correctly.

REMIND: It's a docker compose setup, so vite has to be the real url and Reverb is internal resolved via docker bridge so reverb_host is correct

The channel is found and it should be broadcasted to the correct event:

# .env
REVERB_APP_ID=1234
REVERB_APP_KEY=bxd7gmwhemnahaxwwexj
REVERB_APP_SECRET=qia9xidylaevjvpnaq5t
REVERB_HOST="reverb"
REVERB_PORT=8080
REVERB_SCHEME=http

VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="fivem-acp.lvckyworld.localhost"
VITE_REVERB_PORT=80
VITE_REVERB_SCHEME="${REVERB_SCHEME}"
VITE_REVERB_PATH="/reverb"
// routes/channels.php
<?php

use Filament\Http\Middleware\Authenticate;
use Illuminate\Support\Facades\Broadcast;

Broadcast::routes([
    'middleware' => Authenticate::class
]);

Broadcast::channel('ticket.{ticketId}', function ($user, $ticketId) {
    // $user kann ein Filament-User sein, prüfe ggf. ob er Zugriff auf das Ticket hat
    return true;
}, ['guards' => ['filament']]);
// laravel/app/Filament/Resources/TicketResource/Pages/TicketDetails.php
...
    public function send(): void
    {
        $message = $this->data['message'] ?? null;

        if (empty($message)) {
            session()->flash('error', 'Bitte geben Sie eine Nachricht ein.');
            return;
        }

        $ticketMessage = TicketMessage::create([
            'message' => $message,
            'ticket_id' => $this->record->id,
            'sender_id' => auth()->user()->id,
        ]);

        TicketMessageSent::dispatch($ticketMessage);

        session()->flash('success', 'Nachricht gesendet!');

        // Kein Reload mehr
        $this->reset('data');
    }
...
// the blade teplate
...
            <x-filament::section class="sticky bottom-0 z-2">
                <form wire:submit.prevent="send">
                    <div class="flex-1">
                        <div class="filament-forms-component-container">
                            <div class="filament-forms-rich-editor overflow-auto">
                                {{ $this->form }}
                            </div>
                        </div>
                    </div>
                    <x-filament::button type="submit" size="lg" class="h-12 px-6 w-full mt-4 justify-center">
                        <x-fas-paper-plane class="w-5 h-5 mr-2"/>
                    </x-filament::button>
                </form>
            </x-filament::section>
...
    @vite('resources/js/ticket-details.js')

// laravel/resources/js/ticket-details.js
import Echo from 'laravel-echo';
import axios from 'axios';

window.axios = axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

const ticketId = document.querySelector('[data-ticket-id]')?.getAttribute('data-ticket-id');

window.Echo = new Echo({
    broadcaster: 'reverb',
    key: import.meta.env.VITE_REVERB_APP_KEY,
    wsHost: import.meta.env.VITE_REVERB_HOST,
    wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
    wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
    wsPath: import.meta.env.VITE_REVERB_PATH ?? "/",
    forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
    enabledTransports: ['ws', 'wss'],
});

if (ticketId) {
    console.log(ticketId)
    window.Echo.private(`ticket.${ticketId}`)
        .listen('TicketMessageSent', (e) => {
            addMessageToList(e);
        });
}
2 likes
9 replies
vincent15000's avatar

Have you tried with class TicketMessageSent implements ShouldBroadcastNow instead of class TicketMessageSent implements ShouldBroadcast ?

LvckyAPI's avatar

@vincent15000 yes, there is no difference. The event was not received by reverb. Only the ping stuff:

  Message Received ....................................... 876281088.248199756  
2025-07-28T09:53:04.007002428Z   
2025-07-28T09:53:04.007011220Z    1▕ { 
2025-07-28T09:53:04.007016012Z    2▕     "event": "pusher:ping", 
2025-07-28T09:53:04.007019595Z    3▕     "data": [] 
2025-07-28T09:53:04.007022928Z    4▕ } 
2025-07-28T09:53:04.007024345Z 
2025-07-28T09:53:04.007690803Z   Message Handled ........................................ 876281088.248199756  
1 like
vincent15000's avatar

@LvckyAPI To work on my local computer, I have this configuration, but I don't have used docker with this project.

REVERB_APP_ID=my-app-id
REVERB_APP_KEY=my-app-key
REVERB_APP_SECRET=my-app-secret

REVERB_HOST=localhost
REVERB_PORT=8080
REVERB_SCHEME=http

...

window.Echo = new Echo({
    broadcaster: 'reverb',
    key: import.meta.env.VITE_REVERB_APP_KEY,
    wsHost: import.meta.env.VITE_REVERB_HOST,
    wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
    wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
    forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
    enabledTransports: ['ws', 'wss'],
});
LvckyAPI's avatar

do I have to provide more infos? if yes, what kind of?

1 like
zfhassaan's avatar

Update (06-11-2025 · 6:49 PM)

If you’re not receiving your broadcast events on Reverb - here’s what’s really happening:

Laravel is queuing your broadcast jobs instead of sending them out right away. That’s because your app is using the database queue driver (QUEUE_CONNECTION=database).

To fix it, just run this command to process queued events:

php artisan queue:work

Once the worker starts, your events will flow through to Reverb normally.

Please or to participate in this conversation.