Access form data in modal action

I have the following action

Action::make('foo')
    ->form([
        TextInput::make('fooBar')
    ])
    ->extraModalFooterActions([
        Action::make('bar')
            ->action(function ($record, array $data) {
              // $data  is empty here
            }),
    ])
    ->action(function ($record, array $data) {
      // $data is available here because the form is submitted
    }),


Is there a way to get access to the value of the fooBar field inside Action::make('bar') ?
Was this page helpful?