You have a small typo in your rules. It should be:
$rules = array(
'username' => 'required|alpha_num|min:3|max:32',
'email' => 'required|email',
'password' => 'required|min:3|confirmed',
'password_confirmation' => 'required|min:3'
);
Just for your knowledge, you don't really need to validate password_confirmation. If it must match password, then it must also have the same validation. :)
FYI, if your application is still in development, change 'debug' => false, to 'debug' => true, in your app/config.php so you can see the detailed information of the error and faster identity where is the error.
I have a similar problem with Password not working with confirmed. If I take |confirmed out of the password parameter it saves the user but allows a password of less than 6 characters. Can you let me know the correct syntax to have min:6 and confirmed working?
public static $rules = [
'username' => 'required',
'email' => 'required|unique:users|email',
'password' => 'min:6|required',
'password_confirmation' => 'min:6|same:pass'
];
surferway said:
I have a similar problem with Password not working with confirmed. If I take |confirmed out of the password parameter it saves the user but allows a password of less than 6 characters. Can you let me know the correct syntax to have min:6 and confirmed working?
public static $rules = [ 'username' => 'required', 'email' => 'required|unique:users|email', 'password' => 'min:6|required', 'password_confirmation' => 'min:6|same:pass' ];
'password' => 'required|min:6|confirmed
Solved password validation issue. Please try below method
public static $rules = [
'username' => 'required',
'email' => 'required|unique:users|email',
'password' => 'min:6|required',
'password_confirmation' => 'min:6|same:password'
];
You can match two form field using (same:field name) this method.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community