Filament moderne (groupes nav, 4 charts, filtres/badges) + Filament Shield (rôles/permissions) + noms exos localisés dans routines
Build & Deploy / build (push) Successful in 19s
Build & Deploy / build (push) Successful in 19s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,25 +15,46 @@ class UserForm
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('name')
|
||||
->label('Nom')
|
||||
->required(),
|
||||
TextInput::make('email')
|
||||
->label('Email address')
|
||||
->label('Email')
|
||||
->email()
|
||||
->required(),
|
||||
DateTimePicker::make('email_verified_at'),
|
||||
DateTimePicker::make('email_verified_at')
|
||||
->label('Email vérifié le'),
|
||||
// Requis à la création, laissé vide à l'édition pour ne pas écraser le mot de passe
|
||||
// existant (le cast 'hashed' du modèle User se charge du hachage à la sauvegarde).
|
||||
TextInput::make('password')
|
||||
->label('Mot de passe')
|
||||
->password()
|
||||
->required(),
|
||||
->revealable()
|
||||
->required(fn (string $operation): bool => $operation === 'create')
|
||||
->dehydrated(fn (?string $state): bool => filled($state))
|
||||
->dehydrateStateUsing(fn (?string $state): ?string => filled($state) ? $state : null),
|
||||
TextInput::make('locale')
|
||||
->label('Langue')
|
||||
->required()
|
||||
->default('fr'),
|
||||
Select::make('units')
|
||||
->label('Unités')
|
||||
->options(Units::class)
|
||||
->default('metric')
|
||||
->required(),
|
||||
TextInput::make('timezone'),
|
||||
TextInput::make('avatar_path'),
|
||||
TextInput::make('oidc_sub'),
|
||||
TextInput::make('timezone')
|
||||
->label('Fuseau horaire'),
|
||||
TextInput::make('avatar_path')
|
||||
->label('Avatar (chemin)'),
|
||||
TextInput::make('oidc_sub')
|
||||
->label('Identifiant OIDC'),
|
||||
// Assignation des rôles Spatie (guard 'web') : pilote l'accès au back-office.
|
||||
Select::make('roles')
|
||||
->label('Rôles')
|
||||
->relationship('roles', 'name')
|
||||
->multiple()
|
||||
->preload()
|
||||
->searchable()
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user