Listening for events

Hi there, I was wondering where I'm making a mistake?

I have a Form Component Select

Forms\Components\Select::make('projectstatus_id')
  ->relationship('status', 'naam')
  ->reactive()
  ->registerListeners([
    'updateOptions' => [
      function (Forms\Components\Component $component): void {
        ray($component);
      },
    ],
 ])
 ->label('Current status'),


From withing my custom Livewire component I'm emitting an event

$this->emit('updateOptions');

This works if I check the events tab of the LiveWire devtools.

So how to receive the event from the LiveWire component. The goal is to update the status field with the current status which is changed from within the LiveWire component.
Was this page helpful?