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");
}

// ...
}
<?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',
],
],
// ...
// ...
'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');
}
/**
* 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) => {
// ...
});
Echo.private(`computers`).listen('ComputerReachableStatusUpdated', (e) => {
// ...
});
1 Reply
Quadrubo
QuadruboOP17mo ago
Maybe @maximewill could help here, saw you had tried to set this up aswell here https://discord.com/channels/883083792112300104/883085267383226478/986276300996096020. Sorry for the ping
Want results from more Discord servers?
Add your server