F
Filament14mo ago
terumi

Multi-select update events?

Hello people, I have a multi-select form field that when a new items is added to it, does not trigger an event. I'm doing it like this:
Select::make('users')
->multiple()
->relationship('users', 'name')
->afterStateUpdated(function ($record, Select $component, $state) {
dd($state, $component, $record);
$record->users()->attach($state);
}),
Select::make('users')
->multiple()
->relationship('users', 'name')
->afterStateUpdated(function ($record, Select $component, $state) {
dd($state, $component, $record);
$record->users()->attach($state);
}),
Does anyone know how can I make the value addition/deletion update my record? Thank you!
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server