abstract class DataObject implements Arrayable, Jsonable, JsonSerializable, RequestCastable, Transient

Constants

private KIND_PASSTHROUGH

private KIND_ARRAY

private KIND_BOOLEAN

private KIND_FLOAT

private KIND_INTEGER

private KIND_STRING

private KIND_ENUM

private KIND_DATA_OBJECT

private KIND_DATE

Methods

static DataObject
from(array $data)

Create a new data object from the given values.

static CastsRequestInput|string
castRequestUsing(array $arguments)

Get the caster to use for validated request input.

array
toArray()

Convert the data object to an array.

array
jsonSerialize()

Convert the object into something JSON serializable.

string
toJson(int $options = 0)

Convert the data object to JSON.

static void
flushState()

Flush all static state.

Details

at line 67
static DataObject from(array $data)

Create a new data object from the given values.

Parameters

array $data

Return Value

DataObject

at line 112
static CastsRequestInput|string castRequestUsing(array $arguments)

Get the caster to use for validated request input.

Parameters

array $arguments

Return Value

CastsRequestInput|string

at line 126
array toArray()

Convert the data object to an array.

Return Value

array

at line 144
array jsonSerialize()

Convert the object into something JSON serializable.

Return Value

array

at line 154
string toJson(int $options = 0)

Convert the data object to JSON.

Parameters

int $options

Return Value

string

Exceptions

JsonException

at line 415
static void flushState()

Flush all static state.

Return Value

void