Date Type

Overview

The date field type stores only date.

// streams/example.json
"fields": {
    "starts_at": {
        "type": "date"
    }
}

Configuration

@todo Generate config options from class::configuration

// streams/example.json
"fields": {
    "starts_at": {
        "type": "date",
        "config": {
            "default": "today"
        }
    }
}

Data Structure

{
    "starts_at": "2021-01-01"
}

Basic value access returns the stored value:

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

Decorator Usage

Date types also provide decorated values which returns a Carbon instance.

// Decorated value
{{ $entry->startsAt()->isWeekend() }}

Methods

@todo Generate methods from @docs