trait ResponsableData

Methods

toResponse(Request $request)

Create an HTTP response that represents the data object.

static int
jsonOptions()

Get the JSON serialization options for the resource response.

void
withResponse(Request $request, JsonResponse $response)

Customize the outgoing resource response.

static array|null
allowedRequestIncludes()

Get the request properties that may be included.

static array|null
allowedRequestExcludes()

Get the request properties that may be excluded.

static array|null
allowedRequestOnly()

Get the request properties allowed by an only selection.

static array|null
allowedRequestExcept()

Get the request properties allowed by an except selection.

responseItems(BaseDataCollectable $data)

Get original collection items without transforming or enumerating them twice.

Details

at line 28
JsonResponse toResponse(Request $request)

Create an HTTP response that represents the data object.

Parameters

Request $request

Return Value

JsonResponse

at line 67
static int jsonOptions()

Get the JSON serialization options for the resource response.

Return Value

int

at line 75
void withResponse(Request $request, JsonResponse $response)

Customize the outgoing resource response.

Parameters

Request $request
JsonResponse $response

Return Value

void

at line 82
static array|null allowedRequestIncludes()

Get the request properties that may be included.

Return Value

array|null

at line 90
static array|null allowedRequestExcludes()

Get the request properties that may be excluded.

Return Value

array|null

at line 98
static array|null allowedRequestOnly()

Get the request properties allowed by an only selection.

Return Value

array|null

at line 106
static array|null allowedRequestExcept()

Get the request properties allowed by an except selection.

Return Value

array|null

at line 116
protected Collection responseItems(BaseDataCollectable $data)

Get original collection items without transforming or enumerating them twice.

Parameters

BaseDataCollectable $data

Return Value

Collection