protected function createErrorResponse($content = 'Unknown Error', $code = 500)
    {
        $data = [
            'message' => $content
        ];

        $response = $this->createJsonResponse($data, $code);
        return $response;
    }
protected function createErrorResponse($content = 'Unknown Error', $code = 500)
    {
        $data = [
            'message' => $content
        ];

        $response = $this->createJsonResponse($data, $code);
        return $response;
    }
protected function createErrorResponse ( $ content = 'Unknown Error' , $ code = 500 ) { $ data = [ 'message' => $ content ] ; $ response = $ this -> createJsonResponse ( $ data , $ code ) ; return $ response ; }
Create and return an error response with a standard format

Response will be formatted as a JSON object with the format:
{
"message" : "text"
}

@param  string  $content Response content
@param  integer $code    HTTP response code
@return Response
Create and return an error response with a standard format