src/Traits/MicroServiceJsonResponseTrait.php
protected function generateResponse($type, $data, $code = 200, $status = Status::OK, $message = '')
    {   
        if ($code == 204) {
            return response('', 204);
        }
        $returnData = MicroServiceHelper::jsonResponseFormatter($type, $data, $code, $status, $message);
        return response()->json($returnData, $code);
    }
protected function generateResponse($type, $data, $code = 200, $status = Status::OK, $message = '')
    {   
        if ($code == 204) {
            return response('', 204);
        }
        $returnData = MicroServiceHelper::jsonResponseFormatter($type, $data, $code, $status, $message);
        return response()->json($returnData, $code);
    }
protected function generateResponse ( $ type , $ data , $ code = 200 , $ status = Status :: OK , $ message = '' ) { if ( $ code == 204 ) { return response ( '' , 204 ) ; } $ returnData = MicroServiceHelper :: jsonResponseFormatter ( $ type , $ data , $ code , $ status , $ message ) ; return response ( ) -> json ( $ returnData , $ code ) ; }
Generate a response object in the microservices expected format.

@param string $type
The type of data being returned. Will be used to name the collection.
@param object|array|NULL $data
The data to return. Will always be parsed into a collection.
@param int $code
HTTP status code for the response.
@param string $status
A short status message. Examples: 'OK', 'Bad Request', 'Not Found'.
@param string $message
A more detailed status message.

@return \Illuminate\Http\Response
Generate a response object in the microservices expected format .