Property | Type | Description | |
---|---|---|---|
$includeStatusCode | boolean | Flag indicating if status code should be added to the serialized data. | |
$responseFactory | Illuminate\Contracts\Routing\ResponseFactory | |
Response factory used to generate JSON responses. | |
$statusCode | integer | The HTTP status code for the response. |
Method | Description | |
---|---|---|
__construct ( Illuminate\Contracts\Routing\ResponseFactory | |
Constructor. | |
jsonSerialize ( ) : array | Convert the object into something JSON serializable. | |
respond ( integer $statusCode = null, array $headers = [] ) : Illuminate\Http\JsonResponse | Serialize the data and wrap it in a JSON response object. | |
setIncludeStatusCode ( boolean $includeStatusCode ) : |
Set a flag indicating if status code should be added to the response. | |
setStatus ( integer $statusCode ) : |
Set the HTTP status code for the response. | |
toArray ( ) : array | Convert the response to an array. | |
toCollection ( ) : |
Convert the response to an Illuminate collection. | |
toJson ( integer $options ) : string | Convert the response to JSON. |
Method | Description | |
---|---|---|
includeStatusCode ( array $data ) : array | Include a status code to the serialized data if enabled. |
public __construct ( Illuminate\Contracts\Routing\ResponseFactory | |
||
$responseFactory | Illuminate\Contracts\Routing\ResponseFactory | |
protected includeStatusCode ( array $data ) : array | ||
$data | array | |
return | array |
public jsonSerialize ( ) : array | ||
return | array |
public setIncludeStatusCode ( boolean $includeStatusCode ) : |
||
$includeStatusCode | boolean | |
return |
public toCollection ( ) : |
||
return |
protected bool $includeStatusCode | ||
return | boolean |
protected ResponseFactory,Illuminate\Contracts\Routing|ResponseFactory,Laravel\Lumen\Http $responseFactory | ||
return | Illuminate\Contracts\Routing\ResponseFactory | |
protected int $statusCode | ||
return | integer |