Skip to content

Commit

Permalink
feat: username validation regex updated
Browse files Browse the repository at this point in the history
  • Loading branch information
itsrafsanjani committed Aug 30, 2021
1 parent 01d7963 commit 579fe24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function validator(array $data)
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'username' => ['required', 'string', 'min:4', 'max:32', 'unique:users', 'regex:/(^(?=[a-zA-Z0-9._])(?!.*[_.]{2})[^_.].*[^_.]$)/'],
'username' => ['required', 'string', 'min:4', 'max:32', 'unique:users', 'regex:/(^(?:[a-zA-Z\d]+(?:(?:\.|-|_)[a-zA-Z\d])*)+$)/'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
Expand Down

0 comments on commit 579fe24

Please sign in to comment.