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:

// Basic access
{{ $entry->user->email }}

Decorator Usage

The decorated value also provides the same instance.

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

Methods

@todo Generate methods from @docs

Configuration

@todo Generate config options from class::configuration

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