label(__('filament-support::actions/dissociate.single.label')); $this->modalHeading(fn (): string => __('filament-support::actions/dissociate.single.modal.heading', ['label' => $this->getRecordTitle()])); $this->modalButton(__('filament-support::actions/dissociate.single.modal.actions.dissociate.label')); $this->successNotificationTitle(__('filament-support::actions/dissociate.single.messages.dissociated')); $this->color('danger'); $this->icon('heroicon-s-x'); $this->requiresConfirmation(); $this->action(function (): void { $this->process(function (Model $record): void { /** @var BelongsTo $inverseRelationship */ $inverseRelationship = $this->getInverseRelationshipFor($record); $inverseRelationship->dissociate(); $record->save(); }); $this->success(); }); } }