I need to access $record on Table Action form

I have the following. In relation to the invoiceReadyValue form field. this is a value already stored on the record but I want the ability to edit this field and then save it. I may have a few forms for different actions on the table row. I cannot work out how to prefil the value into the form entry though, its blank but there is a value stored.

Any ideas?

Thanks all.

->actions([
                ActionGroup::make([
                    Action::make('Toggle Supplier Order')
                        ->requiresConfirmation()
                        ->action(fn (docket $record) => $record->update(['docProgSupplierOrder'=> !$record->docProgSupplierOrder ])),
                    Action::make('Submit For Invoicing')
                        ->accessSelectedRecords()
                        ->form([
                            TextInput::make('invoiceReadyValue')->required(),
                        ])
                        ->action(function (array $data, docket $record): void {
                            $record->invoiceReadyValue = $data['invoiceReadyValue'];
                            $record->save();
                            Notification::make()
                                ->title('Invoice Submitted')
                                ->success()
                                ->send();
                        })
                ])
Was this page helpful?