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 !
6 Replies
JJSanders
JJSanders3w ago
Anyone on this one?
JJSanders
JJSanders2w ago
I thinks I can do with this. Let me try it out. This is another hidden gem in filament 😉
LeandroFerreira
worked?
JJSanders
JJSanders2w ago
The custom action model worked indeed. But the whole thing is more complex because I need to make a whole custom modal with a custom form. So still not sure if this is the way to go
toeknee
toeknee2w ago
use ->form() with the custom action?