How to use an external api to validate a data in the validator?

#1

In my package.json
{

“validar-cpf”: “^2.1.0”

}

in My validator
class StoreUser {
get rules() {
cpf : validarCpf(cpf); <<< I want to use the api function in validator, its possible?
}

 get messages(){
      cpf.funcion : "invalid cpf"
 }

}

0 Likes

#2

It looks messy to me.

Start to read the validator documentation first.

You also have a step-by-step guide here.

0 Likes