Get input value in suffix action

Ok I'm probably missing something obvious, but how do you get the TextInput value in a suffixAction?
public function infolist(Schema $schema): Schema
{
return $schema
->statePath('data')
->components([
TextInput::make('foobar')
->live()
->suffixAction(
Action::make('update')
->label('Update')
->action(fn(Get $get, $state, $data, $value) => dd($value, $data, $state, $get('foobar')) // All empty
)
),
]);
}
public function infolist(Schema $schema): Schema
{
return $schema
->statePath('data')
->components([
TextInput::make('foobar')
->live()
->suffixAction(
Action::make('update')
->label('Update')
->action(fn(Get $get, $state, $data, $value) => dd($value, $data, $state, $get('foobar')) // All empty
)
),
]);
}
FWIW, this is a custom page but inside a resource
Solution:
Hey thanks for the reply. It was missing the public array $data declaration. I thought since it was extending Filament\Pages\Page, it would already have that
Jump to solution
3 Replies
LeandroFerreira
I think using ->statePath('data') it should work. Is it a custom livewire component?
Solution
Arnold Schwarzenegger
Hey thanks for the reply. It was missing the public array $data declaration. I thought since it was extending Filament\Pages\Page, it would already have that
Arnold Schwarzenegger
Anyway, I'll mark it as solved

Did you find this page helpful?