Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel Add regx on password

In Controller/Request

 'password' => ['required', 'string','max:255', 'min:8', 'confirmed', 'regex:/[0-9]/', 'regex:/[a-z]/', 'regex:/[A-Z]/'],

In Blade

//8 characters minimum, 1 capital letter minimum, 1 small letter minimum, 1 number minimum.
<input class="form-control type="password" name="password" id="password" 
 pattern="(?=.*d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="8 characters minimum, 1 capital letter minimum, 1 small letter minimum, 1 number minimum." required>
 
PREVIOUS NEXT
Tagged: #Laravel #Add #regx #password
ADD COMMENT
Topic
Name
7+6 =