Access form data in modal action
I have the following action
Is there a way to get access to the value of the
fooBar
field inside Action::make('bar')
?6 Replies
It's ugly, and and probably not the way to go, but I found the form data here:
mountedTableActionsData
is an array, so you might need to choose a different key than 0
depending on your setup.Why not just use $get ?
@Matthew Doesn't work for me
Typed property Filament\Forms\Components\Component::$container must not be accessed before initializationWould need some way of accessing the parent form, as I don't believe it's available there in the nested action inside
extraModalFooterActions
Get wouldn't work to get values outside of the current component usually.
You could try traversal but it's usually out of scope here just to the action.
Ah... or use a form action instead ?
You could do, but he wants the action in the footer with the other actions I assume. Even then the action is isolation I am fairly sure you can't traverse backwards.