Benutzerrollen (Administrator, Vermietung, Inhalte) und Benutzerverwaltung
- Rollenbasierte Policies, Navigationsgruppen - Media Library (Spatie) für die kommende Bildverwaltung installiert Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
08b6582fa1
commit
27ea12901e
25 files changed
+1341
-81
No files matched your search
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Users\Schemas;
|
||||
|
||||
use App\Enums\UserRole;
|
||||
use Filament\Forms\Components\Radio;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class UserForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->columns(2)
|
||||
->components([
|
||||
TextInput::make('name')
|
||||
->label('Name')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('email')
|
||||
->label('E-Mail (Anmeldename)')
|
||||
->email()
|
||||
->required()
|
||||
->unique(ignoreRecord: true)
|
||||
->maxLength(255),
|
||||
Radio::make('role')
|
||||
->label('Rolle')
|
||||
->options(UserRole::class)
|
||||
->required()
|
||||
->columnSpanFull(),
|
||||
TextInput::make('password')
|
||||
->label(fn (string $operation): string => $operation === 'create' ? 'Passwort' : 'Neues Passwort (leer lassen = unverändert)')
|
||||
->password()
|
||||
->revealable()
|
||||
->minLength(10)
|
||||
->required(fn (string $operation): bool => $operation === 'create')
|
||||
->dehydrated(fn (?string $state): bool => filled($state)),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user