Eno\Loaders ยป boolean

boolean() โ†’ boolean
booleanItems() โ†’ array
booleanList() โ†’ array

Accepts true, false, yes and no, returns a boolean (or throws a ValidationError for invalid values).

enoenabled: true
publish: no
visible: not
php$document = Parser::parse($input);

$document->boolean('enabled');  // returns true
$document->boolean('publish');  // returns false

$document->boolean('visible');
  // throws a ValidationError: 'visible' must contain a boolean - allowed values are 'true', 'false', 'yes' and 'no'.