Livewire websockets on page
Does anyone know what I'm doing wrong here? The function is not getting called.
I even tried enabling broadcasting in the
Event is sent here:
Old javascript frontend could receive it:
<?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.phpconfig/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) => {
// ...
});