/** * perform one-way encryption on the password before we store it in the database */ protected function afterValidate() { parent::afterValidate(); $this->password = $this->encrypt($this->password); }
/** * apply a hash on the password before we store it in the database */ protected function afterValidate() { parent::afterValidate(); //ensure we don't have any other errors if (!$this->hasErrors()) { $this->password = $this->hashPassword($this->password); } }