We are using Laravel version 5.\*
We do not want to change this code in our project 
response()->json

It will reflect the whole application and It is terrible. So we need a proper solution and I have found the solution in the comments of this questions. 
Thanks. 

Here is scenario:

```
$response = response()->json(['code' => 1,
    'message' => 'Content-type is ABC',
    'data' => ['code'=>1,'message'=>'Content-type is ABC']
]);

echo json_decode($response); // It always print null and nothing. 
dd($response);  // print Null
return $response; //You will get proper json response in function return.

```

[enter image description here](https://i.stack.imgur.com/nocac.png)