Using echo listeners

Hello, is it possible to listen for events using Echo as described here: https://laravel-livewire.com/docs/2.x/laravel-echo ? I can't seem to get it to work. I have the following in my "Page" (/App/Filament/Resources/ResourceName/Pages/Page.php)
public $showNewOrderNotification = false;

// Special Syntax: ['echo:{channel},{event}' => '{method}']
protected $listeners = ['echo:orders,OrderShipped' => 'notifyNewOrder'];

public function notifyNewOrder()
{
$this->showNewOrderNotification = true;
}
public $showNewOrderNotification = false;

// Special Syntax: ['echo:{channel},{event}' => '{method}']
protected $listeners = ['echo:orders,OrderShipped' => 'notifyNewOrder'];

public function notifyNewOrder()
{
$this->showNewOrderNotification = true;
}
I can see that my event is being triggered in my Ably account, but I don't see that Filament is adding any code that would subscribe the browser to the "orders" channel. Am I missing something or is this not supported?
Livewire
Laravel Echo | Livewire
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
2 Replies
roombroom
roombroomOP16mo ago
Bump
Patrick Boivin
Patrick Boivin16mo ago
I think it looks ok... can you get this to work outside of Filament, in a Livewire component on a plain Laravel route?
Want results from more Discord servers?
Add your server