© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
8 replies
JJSanders

Custom action modal

Hello,

I have got the following question.
I have created a custom action. The action gennerally doesn't need a modal. But sometimes the action does need a model which should then show a form in the modal where the user should fill out some input (this needs to be validated etc)
I can't figure out how to show the modal conditionally.

My code at the moment looks like this:

Actions\Action::make('Connect ingredients')
    ->action(function(Product $product){
         //(... removed some code for simplicity)
        $decider->decide();
        $product->fresh();
        if ($decider->getMessages()) {
            // Here I want to show a modal with a custom form etc. 
        }

        Notification::make()
            ->title('Sucessfull')
            ->color('success')
            ->send();
    })
];
Actions\Action::make('Connect ingredients')
    ->action(function(Product $product){
         //(... removed some code for simplicity)
        $decider->decide();
        $product->fresh();
        if ($decider->getMessages()) {
            // Here I want to show a modal with a custom form etc. 
        }

        Notification::make()
            ->title('Sucessfull')
            ->color('success')
            ->send();
    })
];

Can Anyone guide me in the right direction? Thanks !
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

handle custom action modal
FilamentFFilament / ❓┊help
3y ago
Custom action modal on widget?
FilamentFFilament / ❓┊help
3w ago
Action in custom modal content: Update modal content after action performed?
FilamentFFilament / ❓┊help
2y ago
Disabling Submit Action on Action With Custom Modal
FilamentFFilament / ❓┊help
3y ago