How to get $data from table form action?

I built a rather complex action in my table which looks like this:

->actions([
                Action::make('permissions')
                ->form(function (User $record) {
                    $checkboxLists = [];
                    foreach ($this->project->targets as $target) {
                        $checkboxLists[] = CheckboxList::make('directPermissions')
                            ->label($target->name)
                            ->relationship(
                                titleAttribute: 'name'
                            )
                            ->options(function () use ($target) {
                                $permissions = [];
                                foreach ($this->project->directPermissions()->where('destination_id', $target->id)->get() as $permission) {
                                    $permissions[$permission->id] = $permission->name;
                                }
                                return $permissions;                
                            });
                    }
                    return $checkboxLists;
                })
                ->fillForm(function ($record) {
                    return $record->toArray();
                })
                ->model(function ($record) {
                    return $record;
                })
                ->action(function (array $data, $record, RelationManager $livewire) {
                    logger()->debug('Permissions data', $data);
                })
            ])


This works perfectly fine and correctly sets the user's permissions in their project. The problem is that I am just not able to get the $data in the ->action -method. After submitting the form the $data seems to be empty:
[2024-05-08 08:31:58] production.DEBUG: Permissions data

So the ->action-method is triggered correctly but is not getting any data back from the form?
Was this page helpful?