Reactive validation

In one of my resources I built a wizard and inside the first step I have a select field
Select::make('accessory') I'm trying to do some reactive validation (database checking) using afterStateUpdated(), it never shows the error, even when doing static debugging like shown below: ->afterStateUpdated(function ($state, $set, $get, $livewire) { $livewire->resetErrorBag('accessory'); $testErrorString = 'test error string'; $livewire->addError('accessory', $testErrorString); } Do you have any ideas how could this work?
1 Reply
hellomotto
hellomotto6mo ago
I have live() Notifications get triggered but errors are not showing: Select::make('accessory') ->afterStateUpdated(function ($set, $state, $get, $livewire) { $errorString = 'hello'; $livewire->addError('accessory', $errorString); Notification::make() ->title('triggered') ->danger() ->send(); } Solution: $livewire->addError('data.accessory', $errorString); Thanks to Leandro!