public function validate(Message $message)
 {
     $this->rule('name', ['required', 'username']);
     $this->rule('email', ['required', 'email']);
     $this->rule('password', 'password');
     $this->rule('password2', 'required', 'Password re-type required');
     parent::validate($message);
     if ($this->password != $this->password2) {
         $message->error('Reentered password doesn\'t correct');
         throw new PostValidationException('incorrect password re-type');
     }
 }
 public function validate(Message $message)
 {
     $this->rule('user', 'required', 'User name is required');
     $this->rule('password', 'required', 'Password is required');
     return parent::validate($message);
 }