© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
Raj Siva-Rajah

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.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Actions inside modal
FilamentFFilament / ❓┊help
3y ago
Global Form/Modal Actions Alignment
FilamentFFilament / ❓┊help
2y ago
"anonymous" actions to a form but only on edit?
FilamentFFilament / ❓┊help
3y ago
Testting anonymous actions
FilamentFFilament / ❓┊help
2y ago