Modal not closing after action

Ive tried closing in both the action() and after() with no luck. Its properly making the change, just got closing after. I know i must be missing something simple.
->modalFooterActions(fn ($action) => [
Tables\Actions\Action::make('reject')
->requiresConfirmation()
->action(function (ComparableUnit $record, $action) {
$record->rftas()->updateExistingPivot($this->getOwnerRecord()->id, ['status' => ComparableUnitRftaStatus::Rejected]);
return $action->cancel();
}),
$action->getModalCancelAction(),
]),
->modalFooterActions(fn ($action) => [
Tables\Actions\Action::make('reject')
->requiresConfirmation()
->action(function (ComparableUnit $record, $action) {
$record->rftas()->updateExistingPivot($this->getOwnerRecord()->id, ['status' => ComparableUnitRftaStatus::Rejected]);
return $action->cancel();
}),
$action->getModalCancelAction(),
]),
1 Reply
Mark Chaney
Mark ChaneyOP9mo ago
Im a bit lost on this one. Has to be something simple this seems to work
->action(function (ComparableUnit $record, $action) {
$record->updateRftaPivot($this->getOwnerRecord()->id, ['status' => ComparableUnitRftaStatus::Rejected]);
$action->cancelParentActions();
})->after(function () {
Notification::make()
->title('Comparable Unit Rejected')
->success()
->send();
}),
->action(function (ComparableUnit $record, $action) {
$record->updateRftaPivot($this->getOwnerRecord()->id, ['status' => ComparableUnitRftaStatus::Rejected]);
$action->cancelParentActions();
})->after(function () {
Notification::make()
->title('Comparable Unit Rejected')
->success()
->send();
}),
Seems like i shouldnt really have to cancel though. want actions to happen and would like to be able to do a simple success notification and close the modal, but oh well. this functions fine.
Want results from more Discord servers?
Add your server