Beliebige Entra-Attribute ins Profil übernehmen; eigene Profilfelder
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m43s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m52s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m12s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 1m59s
CI / Build-Artefakte aktuell (pull_request) Successful in 57s

- Profilfelder frei definierbar (Typ, Sichtbarkeit, selbst pflegbar), Werte als JSON am Benutzer
- Attribut-Zuordnung je Anbieter statt fester Feldliste: jedes Graph-Attribut inkl.
  verschachtelter Pfade, onPremisesExtensionAttributes und Verzeichniserweiterungen
- Erweiterungsattribute per Knopf aus Entra laden
- $select dynamisch aus der Zuordnung; Delta-Abgleich startet bei geänderter Zuordnung neu
- Rückfall auf Grundattribute, wenn einzelne Attribute nicht lesbar sind
- Ältere Konfiguration (synced_fields) wird weiter gelesen

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 08:09:57 +00:00
parent 51c94cd0cf
commit 6269d3302c
79 changed files with 1442 additions and 273 deletions

View file

@ -2,12 +2,16 @@
namespace App\Filament\Resources\Users\Schemas;
use App\Models\ProfileField;
use App\Models\Role;
use App\Models\User;
use App\Support\ProfileFields;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Component;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Illuminate\Validation\Rules\Password;
@ -16,6 +20,30 @@ class UserForm
{
public const PHONE_REGEX = '/^[0-9+()\/\-.\s]{3,50}$/';
/**
* Eingabefelder für die frei definierten Profilfelder.
*
* @return list<Component>
*/
private static function customFields(): array
{
return app(ProfileFields::class)->all()->map(function (ProfileField $field) {
$name = 'custom_fields.'.$field->key;
$hint = $field->visibility === 'restricted' ? 'Nur für die Person und die Personalverwaltung sichtbar.' : null;
$component = match ($field->type) {
'textarea' => Textarea::make($name)->rows(3)->maxLength(5000)->columnSpanFull(),
'date' => DatePicker::make($name)->native(false)->displayFormat('d.m.Y'),
'email' => TextInput::make($name)->email()->maxLength(255),
'url' => TextInput::make($name)->url()->maxLength(500),
'phone' => TextInput::make($name)->tel()->telRegex(self::PHONE_REGEX)->maxLength(50),
default => TextInput::make($name)->maxLength(255),
};
return $component->label($field->label)->helperText($hint);
})->values()->all();
}
public static function configure(Schema $schema): Schema
{
return $schema
@ -79,6 +107,11 @@ class UserForm
->rule(Password::default())
->dehydrated(fn (?string $state) => filled($state)),
]),
Section::make('Weitere Angaben')
->columnSpan(2)
->columns(2)
->schema(fn () => self::customFields())
->visible(fn () => app(ProfileFields::class)->all()->isNotEmpty()),
]);
}
}