getErrorType(); $response['title'] = $this->getMessage(); $response['details'] = $this->getErrorDetails(); $response['status'] = $this->getStatusCode(); // For backwards compatibility $response['error'] = [ 'status' => $this->getStatusCode(), 'message' => $this->getErrorDetails(), ]; return array_merge($response, $this->getErrorMetadata()); } /** * Return a response object that can be used by Laravel * * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response */ public function getResponse() { $headers = []; $headers['content-type'] = 'application/problem+json'; $headers = array_merge($headers, $this->getHeaders()); return response()->json($this->getJson(), $this->getStatusCode(), $headers); } }