How to access $form in Forms?

This code is not working:
Forms\Components\Actions::make([
Forms\Components\Actions\Action::make('customstuff')
->action(function ($form) {
dd($form); // doesn't work; returns null
})
]),
Forms\Components\Actions::make([
Forms\Components\Actions\Action::make('customstuff')
->action(function ($form) {
dd($form); // doesn't work; returns null
})
]),
I want to be able to access stuff like $form->getRecord()->id in action(). How to do that?
2 Replies
JJSanders
JJSanders4mo ago
I think you can use $record for that
Dennis Koch
Dennis Koch4mo ago
Where did you find $form? It probably should be $livewire. Also see the comment above.