before(function (PlanFeature $record) { // Prevent deletion if feature is used in plans if ($record->planFeatureLimits()->exists()) { throw new \Exception('Cannot delete feature that is used in plans'); } }), ]; } protected function getRedirectUrl(): string { return $this->getResource()::getUrl('index'); } protected function getSavedNotification(): ?Notification { return Notification::make() ->success() ->title('Feature updated') ->body('Plan feature updated successfully'); } }