setError() публичный Метод

Set the error code and optionally an error message.
public setError ( string $errorCode = null, string | array | null $message = null ) : ErrorResponseBuilder
$errorCode string
$message string | array | null
Результат ErrorResponseBuilder
Пример #1
0
 /**
  * Generate an error JSON response.
  *
  * @param  string|null $errorCode
  * @param  int|null    $statusCode
  * @param  mixed       $message
  * @return \Illuminate\Http\JsonResponse
  */
 public function error(string $errorCode = null, int $statusCode = null, $message = null) : JsonResponse
 {
     return $this->errorResponse->setError($errorCode, $message)->respond($statusCode);
 }