I'm doing user editing facility for my admin panel. I want to ignore empty password on update, but not on create.
I have following validation rules for User model:
public static $rules = array(
'login' => 'required|max:255|alpha_dash|unique',
'displayname' => 'required|max:255|unique',
'email' => 'required|email|max:255|unique',
'password' => 'required|confirmed',
'password_confirmation' => 'required',
);
But it doesn't let me update user model when I don't pass password to it. It just complains about not having a password.
How to make it work?