F
Filament15mo ago
Mis Tsu

Show modal box after new product created

Hello, I have a product resource, and I want to show a modal box after a new product is created with the created product's data. How can I do it?
3 Replies
Patrick Boivin
Patrick Boivin15mo ago
Is this a simple resource (create in modal), or do you have a dedicated Create page?
Mis Tsu
Mis TsuOP15mo ago
this is a simple resource
Patrick Boivin
Patrick Boivin14mo ago
In your resource class, you can add ViewAction to your table actions. Then on the ManageItems class, you can customize the CreateAction like this:
CreateAction::make()
->after(function ($record, $livewire) {
$livewire->mountTableAction('view', $record->id);
}),
CreateAction::make()
->after(function ($record, $livewire) {
$livewire->mountTableAction('view', $record->id);
}),
It will call the View action, right after the Create action.
Want results from more Discord servers?
Add your server