© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
6 replies
Jens

Close modal from a "extraModalFooterActions"

I have a table with a
Filament\Tables\Actions\Action
Filament\Tables\Actions\Action
action that opens a modal. This modal also has a
extraModalFooterActions
extraModalFooterActions
action which works as expected. I want the modal to close when the
extraModalFooterActions
extraModalFooterActions
action is completed, how can I go about this?

I can't seem to find a way to give the modal a custom ID or retrieve the modals ID to be able to dispatch a close event.

This is my current code:

Tables\Actions\Action::make('edit-followup')->label(__('messages.table.action.followup.edit-followup'))
                    ->icon('heroicon-o-pencil-square')
                    ->before(function (Tables\Actions\Action $action, \App\Models\FollowUp $record) {
                        // Authorize the action
                        Gate::forUser(auth()->user())->authorize('update', $record);
                    })
                    ->modalContent(function(\App\Models\FollowUp $record) {
                        return view(
                            'followups.input',
                            [
                                'input' => $record->input,
                            ],
                        );
                    })
                    ->modalSubmitAction(false)
                    ->extraModalFooterActions(function ($action) {
                        return [
                            Tables\Actions\Action::make('save-form')->label(__('messages.table.action.followup.save-form'))
                                ->action(function(\App\Models\FollowUp $record) {
                                    $this->dispatch('vueform.submit.' . $record->input->id);
                                    // Close the modal here?
                                })
                                ->after(function() {
                                    // Close the modal here?
                                })
                        ];
                    }),
Tables\Actions\Action::make('edit-followup')->label(__('messages.table.action.followup.edit-followup'))
                    ->icon('heroicon-o-pencil-square')
                    ->before(function (Tables\Actions\Action $action, \App\Models\FollowUp $record) {
                        // Authorize the action
                        Gate::forUser(auth()->user())->authorize('update', $record);
                    })
                    ->modalContent(function(\App\Models\FollowUp $record) {
                        return view(
                            'followups.input',
                            [
                                'input' => $record->input,
                            ],
                        );
                    })
                    ->modalSubmitAction(false)
                    ->extraModalFooterActions(function ($action) {
                        return [
                            Tables\Actions\Action::make('save-form')->label(__('messages.table.action.followup.save-form'))
                                ->action(function(\App\Models\FollowUp $record) {
                                    $this->dispatch('vueform.submit.' . $record->input->id);
                                    // Close the modal here?
                                })
                                ->after(function() {
                                    // Close the modal here?
                                })
                        ];
                    }),
Solution
I think you just need to use makeModalSubmitAction() here. have you read this:
https://filamentphp.com/docs/3.x/actions/modals#adding-an-extra-modal-action-button-to-the-footer
Modals - Actions - Filament
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

extraModalFooterActions in EditAction modal
FilamentFFilament / ❓┊help
2y ago
How To Close Modal Action After Successful Run in extraModalFooterActions?
FilamentFFilament / ❓┊help
2y ago
Close Modal From Child & Parent
FilamentFFilament / ❓┊help
5mo ago
Close modal from List HeaderActions
FilamentFFilament / ❓┊help
13mo ago