Support the ongoing development of Laravel.io →
Authentication Input Validation
Last updated 2 years ago.
0

confirmed*

Last updated 2 years ago.
0

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. :)

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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'	
];
Last updated 2 years ago.
0

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  
Last updated 2 years ago.
0

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

gilganebu gilganebu Joined 14 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.