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
        })
]),


I want to be able to access stuff like $form->getRecord()->id in action(). How to do that?
Was this page helpful?