Laravel-Model-Validation
Laravel-Model-Validation copied to clipboard
Validation on Update Method
Within my controller's update function, I run some code to save any updated fields to the database.
My password has the following validation required|between:8,20
If the password field has not changed I reapply the existing password to the field so that the required
validation is satisfied. However, now, as it's a hashed password of 60 characters in length, the between
rule fails.
Ideally, I'd like for the password to only be required for create methods, but to not be required for update methods. Is this possible?
@danhanly, maybe you need to implement something like http://laravel.com/docs/4.2/validation#conditionally-adding-rules?