public function emptyOnInvalid($attribute, $params) { if ($this->hasErrors()) { $this->verifyCode = null; } }