getErrorType(); $response['title'] = $this->getMessage(); $response['details'] = $this->getErrorDetails(); // 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 */ public function getResponse() { return response() ->json( $this->getJson(), $this->getStatusCode(), [ 'content-type' => 'application/problem+json', ] ); } }