record->attributeMap()) ->map(fn ($attribute, $target) => ['target' => $target, 'attribute' => $attribute])->values()->all(); $data['config']['sync_manager'] = $this->record->syncsManager(); } return $data; } /** * Leeres Geheimnis = gespeichertes behalten. */ protected function mutateFormDataBeforeSave(array $data): array { if (blank($data['config']['client_secret'] ?? null)) { $data['config']['client_secret'] = $this->record->setting('client_secret'); } // Geladene Erweiterungen liegen nur in der Datenbank, nicht im Formular. $data['config']['extension_properties'] = $this->record->fresh()?->setting('extension_properties', []) ?? []; $data['config']['attribute_map'] = array_values((array) ($data['config']['attribute_map'] ?? [])); unset($data['config']['synced_fields']); return $data; } protected function afterSave(): void { Audit::log('identity.provider_updated', ['provider' => $this->record->name, 'enabled' => $this->record->enabled]); } protected function getHeaderActions(): array { return [ Action::make('test')->label('Mapping testen')->icon(Heroicon::OutlinedBeaker)->color('gray') ->url(fn () => IdentityProviderResource::getUrl('test', ['record' => $this->record])), DeleteAction::make()->modalDescription('Verknüpfungen und Rollen aus Entra-Gruppen werden entfernt. Die Konten selbst bleiben bestehen.'), ]; } }