Using older version of Indicative or @adonisjs/validator?. Click here to access the old version documentation.

validations

boolean

Enforces the field value to be a valid boolean representation. The rule will attempt to cast following values to their boolean counter part.

Casts fromCasts to
string ('0')boolean (false)
string ('1')boolean (true)
string ('false')boolean (false)
string ('true')boolean (true)
number ('0')boolean (false)
number ('1')boolean (true)