FilamentF
Filament3y ago
sm

Integrating with Livewire/Laravel eventing.

Hey guys,

I was wondering if anyone could point me to docs/source on how filament integrates with livewire eventing? For example, if I have a TableWidget that's included via a ViewComponent and fire an event from an action within the TableWidget (for example: a select action), I can't seem to listen for that event from the parent Form. I've tried just adding a protected $listeners = ['eventName' => 'someFunc']; and setting $this->data from there, but the event doesn't seem to get through (is this something to do with emit direction?).

Also, it doesn't seem like I can use $this->emit() on form component closures, even though Filament uses livewire under the hood, is that expected? What's the right way to dispatch an event? is it using dispatchEvent from a closure to which we pass the current instance?

Thanks!
Was this page helpful?