Workaround for password confirmation with Laravel & Ardent
While I was working on a website made with Laravel and Ardent I had to validate a password confirmation field for a user registration. This will not work if you follow the standard documentation.
1public static $rules = array( 2 'email' => 'required|email|max:100|unique:users', 3 'password' => 'required|min:6|confirmed', 4);
Your model should also have the following line somewhere:
1public $autoPurgeRedundantAttributes = true;
Now, if you follow the documentation and include every database field in the fillable array, validation will always fail on the password confirmation.
The workaround is to include the password confirmation field in the fillable array, even if it isn’t a column in your database.
1protected $fillable = array('email', 'password', 'activation_code', 'confirmed', 'reset_password', 'password_confirmation');