Property | Type | Description | |
---|---|---|---|
$data | array | Optional error data appended with the response. | |
$errorCode | string | The error code used to identify the error. | |
$message | string | A descriptive error message explaining what went wrong. | |
$parameters | array | Any parameters used to build the error message. | |
$statusCode | integer | The HTTP status code for the response. | |
$translator | Symfony\Component\Translation\TranslatorInterface | Translator service used for translating stuff. |
Method | Description | |
---|---|---|
__construct ( Illuminate\Contracts\Routing\ResponseFactory | |
Constructor. | |
addData ( array $data ) : |
Add additonal data appended to the error object. | |
setError ( string $errorCode = null, string | array | null $message = null ) : |
Set the error code and optionally an error message. | |
setStatus ( integer $statusCode ) : |
Set the HTTP status code for the response. | |
toArray ( ) : array | Serialize the data and return as an array. |
Method | Description | |
---|---|---|
buildErrorData ( ) : array | null | Build the error object of the serialized response data. | |
resolveMessage ( ) : string | null | Resolve an error message from the translator. |
public __construct ( Illuminate\Contracts\Routing\ResponseFactory | |
||
$responseFactory | Illuminate\Contracts\Routing\ResponseFactory | |
|
$translator | Symfony\Component\Translation\TranslatorInterface |
protected buildErrorData ( ) : array | null | ||
return | array | null |
protected resolveMessage ( ) : string | null | ||
return | string | null |
protected array $data | ||
return | array |
protected string $errorCode | ||
return | string |
protected string $message | ||
return | string |
protected array $parameters | ||
return | array |
protected int $statusCode | ||
return | integer |