requiresConfirmation() ->modalDescription( fn (ConfigOption $record) => $record->children()->exists() ? 'This config option has services connected to it. Deleting it will also delete it from the services it is associated with. Are you sure you want to delete this config option?' : 'Are you sure you want to delete this config option?', ) ->action(function () { $this->record->serviceConfigs()->delete(); $this->record->delete(); return redirect()->to(ConfigOptionResource::getUrl()); }), ]; } }