before(function (PlanTier $record) { // Prevent deletion if tier has child tiers or plans if ($record->childTiers()->exists()) { throw new \Exception('Cannot delete tier that has child tiers'); } if ($record->plans()->exists()) { throw new \Exception('Cannot delete tier that has plans assigned'); } }), ]; } protected function getRedirectUrl(): string { return $this->getResource()::getUrl('index'); } protected function getSavedNotification(): ?Notification { return Notification::make() ->success() ->title('Tier updated') ->body('Plan tier updated successfully'); } }