Свойство | 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. |
Méthode | 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. |
Méthode | 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 | |
Résultat | array |
public jsonSerialize ( ) : array | ||
Résultat | array |
public setIncludeStatusCode ( boolean $includeStatusCode ) : |
||
$includeStatusCode | boolean | |
Résultat |
public toCollection ( ) : |
||
Résultat |
protected bool $includeStatusCode | ||
Résultat | boolean |
protected ResponseFactory,Illuminate\Contracts\Routing|ResponseFactory,Laravel\Lumen\Http $responseFactory | ||
Résultat | Illuminate\Contracts\Routing\ResponseFactory | |
protected int $statusCode | ||
Résultat | integer |