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
Is this a simple resource (create in modal), or do you have a dedicated Create page?
Mis Tsu
Mis TsuOP2y ago
this is a simple resource
Patrick Boivin
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.

Did you find this page helpful?