Add min length check (#730)

This commit is contained in:
MartinOscar 2024-11-27 09:02:41 +01:00 committed by GitHub
parent ad9447e974
commit 951fc73363
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 1 deletions

View File

@ -113,6 +113,7 @@ class CreateServer extends CreateRecord
TextInput::make('username')
->alphaNum()
->required()
->minLength(3)
->maxLength(255),
TextInput::make('email')

View File

@ -24,7 +24,7 @@ class EditUser extends EditRecord
return $form
->schema([
Section::make()->schema([
TextInput::make('username')->required()->maxLength(255),
TextInput::make('username')->required()->minLength(3)->maxLength(255),
TextInput::make('email')->email()->required()->maxLength(255),
TextInput::make('password')
->dehydrateStateUsing(fn (string $state): string => Hash::make($state))

View File

@ -92,6 +92,7 @@ class ListUsers extends ListRecords
->alphaNum()
->required()
->unique()
->minLength(3)
->maxLength(255),
TextInput::make('email')
->email()