Laravel Add regx on password
0
1
In Controller/Request
2
3
'password' => ['required', 'string','max:255', 'min:8', 'confirmed', 'regex:/[0-9]/', 'regex:/[a-z]/', 'regex:/[A-Z]/'],
4
5
In Blade
6
7
//8 characters minimum, 1 capital letter minimum, 1 small letter minimum, 1 number minimum.
8
<input class="form-control type="password" name="password" id="password"
9
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="8 characters minimum, 1 capital letter minimum, 1 small letter minimum, 1 number minimum." req
0 comments:
Post a Comment
Thanks