Boolean Type

Overview

The boolean field type stores true/false values.

// streams/users.json
"fields": {
    "enabled": {
        "type": "boolean"
    }
}

Data Structure

{
    "enabled": true
}

Basic value access displays the stored key value:

// Basic access
{{ $entry->enabled }}

Decorator Usage

Boolean types also provide decorated values.

// Decorated value
@if ($entry->enabled()->isTrue())
    // ...
@endif

Methods

@todo Generate methods from @docs

Configuration

@todo Generate config options from class::configuration

// streams/users.json
"fields": {
    "enabled": {
        "type": "boolean",
        "config": {
            "default": false
        }
    }
}