How would I return a modal form in the Resource Edit Page?

The context is like this: I am in my resource's record edit page and in the form, I have a viewfield that returns a template with a button. I now have a function in the Resource's Edit Page where the getHeaderActions is located that waits for the button to be triggered. After clicking the button, the function updates some attributes of the record but something new that I wanna try is return a modal form instead for normal form use like a TextInput or a FileUpload. So far what I've tried to do is like this:
public function updateAttribute(): void
{
return Actions\Action::make('modal')
->modalHeading('Modal Heading')
->form([
FileUpload::make('files')
->label('Files')
->required()
])
->action(function (array $data) use ($record) {
// Process the file upload
});
}
public function updateAttribute(): void
{
return Actions\Action::make('modal')
->modalHeading('Modal Heading')
->form([
FileUpload::make('files')
->label('Files')
->required()
])
->action(function (array $data) use ($record) {
// Process the file upload
});
}
But when I click the button, nothing happens so I tried putting a Filament Notification before returning the action and the notification did show up but not the modal form. Any ideas?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server