Livewire websockets on page

Does anyone know what I'm doing wrong here? The function is not getting called.

<?php

namespace App\Filament\Pages;

// ...

class WakeComputers extends Page
{
    // ...

    protected $listeners = ['echo-private:computers,ComputerReachableStatusUpdated' => 'notifyNewOrder'];

    public function notifyNewOrder()
    {
        dd("notify new order");
    }

    // ...
}


I even tried enabling broadcasting in the config/filament.php.
// ...
    'broadcasting' => [
        'echo' => [
            'broadcaster' => 'pusher',
            'key' => env('VITE_PUSHER_APP_KEY'),
            'cluster' => env('VITE_PUSHER_APP_CLUSTER', 'mt1'),
            'wsHost' => env('VITE_PUSHER_HOST'),
            'wsPort' => env('VITE_PUSHER_PORT', 80),
            'wssPort' => env('VITE_PUSHER_PORT', 443),
            'forceTLS' => env('VITE_PUSHER_SCHEME', 'https') === 'https',
        ],
    ],
// ...


Event is sent here:

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('computers');
    }


Old javascript frontend could receive it:

Echo.private(`computers`).listen('ComputerReachableStatusUpdated', (e) => {
    // ...
});
Was this page helpful?