@xfra35: actually i'm comparing the raw values, but `set_password` method replace the value of `password` with `Bcrypt::instance()->hash($pswd)`. So, I can;t compare the raw value.
I want to know that how can I validate client/user provided data through `beforesave` trigger, if, some parameters will replaced by the `set_` method of model?
For example: the code in this post is for `user registration`, where user `post` the form, containing `email, password, password_confirmation`. Than the `route controller` will execute `$model->copyFrom($data, array_keys($model->fields)); $model->save();`
Now, the model validation works like a charm if there is no `confirm` validator. Because before validating these parameters, the `set_` method replace the original value.
By the sorry for my bad english.
Thanks