F
Filament11mo ago
Damien

makeModalSubmitAction arguments are empty?

I am trying to use the above method to implment a 'save & create another' action however the arguments are always empty even though I am passing it. I took the the example straight from the documentation, code below:
->extraModalFooterActions(fn (Action $action): array => [
// TODO: Get argument to be received by action to identify when modal should be reloaded
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true]),
])
->action(function (array $arguments) {
if ($arguments['another'] ?? false) {
// Reset the form and don't close the modal
dd('another');
}

// ... other form logic
});
->extraModalFooterActions(fn (Action $action): array => [
// TODO: Get argument to be received by action to identify when modal should be reloaded
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true]),
])
->action(function (array $arguments) {
if ($arguments['another'] ?? false) {
// Reset the form and don't close the modal
dd('another');
}

// ... other form logic
});
Not really sure why $arguments is always empty.
4 Replies
Stemonte
Stemonte11mo ago
Still not working
toeknee
toeknee11mo ago
What version are you on?
Stemonte
Stemonte11mo ago
"version": "v3.2.10" I’m using it on a suffixAction of a TextInput
Damien
DamienOP11mo ago
I did get mine working in the end, but only once I moved to declaring the form within the form method instead of outside of it. Going to close this as I am no longer having issues with it but I will not mark it as sold.
Want results from more Discord servers?
Add your server