Use anonymous actions inside a modal form

EDIT: This actually works. The problem was caused by something else. Hi all Is there a way of using actions inside a modal form? I don't mean in the footer - I mean in the form body eg:
Actions::make([
Action::make('myModalAction')
->label('Open')
->modal()
->modalHeading('Heading')
->modalDescription('Description')
->modalSubmitActionLabel('Confirm')
->form([
TextInput::make('code')
->required()
->autofocus(),

Actions::make([
Action::make('resend')
->label('Resend code')
->link()
->action(function () {
// do something
}),
]),
])
->action(function ($model) {
// do something
}),
]);
Actions::make([
Action::make('myModalAction')
->label('Open')
->modal()
->modalHeading('Heading')
->modalDescription('Description')
->modalSubmitActionLabel('Confirm')
->form([
TextInput::make('code')
->required()
->autofocus(),

Actions::make([
Action::make('resend')
->label('Resend code')
->link()
->action(function () {
// do something
}),
]),
])
->action(function ($model) {
// do something
}),
]);
This isn't working for me. I'd really prefer to put a "Resend" link under the input instead of a button in the footer.
2 Replies
LeandroFerreira
LeandroFerreira9mo ago
what isn't working?
binaryfire
binaryfireOP9mo ago
I was just editing my post. This actually works - the problem was elsewhere
Want results from more Discord servers?
Add your server