Relationship Type

Overview

A single relationship to a stream entry.

// streams/users.json
"fields": {
    "user": {
        "type": "relationship",
        "config": {
            "related": "users"
        }
    }
}

Data Structure

{
    "user": "655de760-6ba0-3f4f-ad0c-8051588ad6e2"
}

Basic value access displays the entry instance:

@verbatim// Basic access
{{ $entry->user->email }}@endverbatim

Decorator Usage

The decorated value also provides the same instance.

@verbatim// Decorated value
{{ $entry->user()->email }}
{!! $entry->user()->email()->mailto() !!}@endverbatim

Methods

@todo Generate methods from @docs

Configuration

@todo Generate config options from class::configuration

// streams/users.json
"fields": {
    "user": {
        "type": "relationship",
        "config": {
            "related": "users"
        }
    }
}