src/Http/Responds.php
public function respondWithError($code = null, $message = null, array $data = []): JsonResponse
    {
        return $this->respond([
            'status' => [
                'type' => 'error',
                'message' => $this->getDefaultMessage($code, $message),
                'code' => $code,
                'http_code' => $this->getStatusCode(),
            ],
            'exception' => $data,
        ]);
    }
public function respondWithError($code = null, $message = null, array $data = []): JsonResponse
    {
        return $this->respond([
            'status' => [
                'type' => 'error',
                'message' => $this->getDefaultMessage($code, $message),
                'code' => $code,
                'http_code' => $this->getStatusCode(),
            ],
            'exception' => $data,
        ]);
    }
public function respondWithError ( $ code = null , $ message = null , array $ data = [ ] ) : JsonResponse { return $ this -> respond ( [ 'status' => [ 'type' => 'error' , 'message' => $ this -> getDefaultMessage ( $ code , $ message ) , 'code' => $ code , 'http_code' => $ this -> getStatusCode ( ) , ] , 'exception' => $ data , ] ) ; }
Return response with error.

@param null $code
@param null $message
@param array $data

@return JsonResponse
Return response with error .