This commit is contained in:
salam committed 2025-10-15 11:47:47 +02:00
1 parent 18ce61bc9b
commit 76f4127bb2
8 files changed
+177 -64

No files matched your search

@@ -21,15 +21,24 @@ class UserForm
Section::make('Benutzerkonto')
->icon('lucide-user')
->schema([
TextInput::make('name')->required(),
Select::make('gender')
->prefixIcon('phosphor-gender-neuter')
->label('Geschlecht')
->options([
'Herr' => 'Herr',
'Frau' => 'Frau',
'Non-binary' => 'Non-binary',
])
->required(),
TextInput::make('name')
->prefixIcon('phosphor-user')
->required(),
TextInput::make('email')->email()
->required()
->prefixIcon('phosphor-envelope')
->label('E-Mail'),
]),
Section::make('Sicherheit')
->icon('lucide-lock')
->schema([
TextInput::make('password')
->prefixIcon('phosphor-lock')
->label('Passwort')
->password() // Masks the input
->required()
@@ -38,19 +47,22 @@ class UserForm
->dehydrateStateUsing(fn ($state) => bcrypt($state)) // Hashes the password before saving
->label('Password'),
TextInput::make('password_confirmation')
->prefixIcon('phosphor-lock')
->password() // Masks the input
->required()
->same('password') // Validates that this matches the 'password' field
->label('Passwort Bestätigen'),
Select::make('roles')
->label('Rolle')
->prefixIcon('phosphor-gear')
->aboveContent('Nur für SuperAdmin sichtbare')
->visible(fn () => auth()->user()->hasRole('super_admin'))
->relationship('roles', 'name')
->multiple()
->preload()
->searchable(),
]),
Select::make('roles')
->label('Rolle')
->visible(fn () => auth()->user()->hasRole('super_admin'))
->relationship('roles', 'name')
->multiple()
->preload()
->searchable(),
])->columns(1);
}
}