Skip to content

Commit 8badb41

Browse files
committed
docs: update default validation rules
1 parent b080a71 commit 8badb41

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

docs/customization/validation_rules.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ Shield has the following rules for registration by default:
2727
],
2828
'password' => [
2929
'label' => 'Auth.password',
30-
'rules' => 'required|max_byte[72]|strong_password[]',
30+
'rules' => [
31+
'required',
32+
'max_byte[72]',
33+
'strong_password[]',
34+
],
3135
'errors' => [
3236
'max_byte' => 'Auth.errorPasswordTooLongBytes'
3337
]
@@ -98,8 +102,13 @@ Similar to the process for validation rules in the **Registration** section, you
98102
//--------------------------------------------------------------------
99103
public $login = [
100104
// 'username' => [
101-
// 'label' => 'Auth.username',
102-
// 'rules' => 'required|max_length[30]|min_length[3]|regex_match[/\A[a-zA-Z0-9\.]+\z/]',
105+
// 'label' => 'Auth.username',
106+
// 'rules' => [
107+
// 'required',
108+
// 'max_length[30]',
109+
// 'min_length[3]',
110+
// 'regex_match[/\A[a-zA-Z0-9\.]+\z/]',
111+
// ],
103112
// ],
104113
'email' => [
105114
'label' => 'Auth.email',
@@ -111,7 +120,10 @@ public $login = [
111120
],
112121
'password' => [
113122
'label' => 'Auth.password',
114-
'rules' => 'required|max_byte[72]',
123+
'rules' => [
124+
'required',
125+
'max_byte[72]',
126+
],
115127
'errors' => [
116128
'max_byte' => 'Auth.errorPasswordTooLongBytes',
117129
]

0 commit comments

Comments
 (0)