return Response::json(array('status' => 'Group not found'));
returns protected data. Here's the JSON:
{"status":"Group not found"}
The following code
//$jsonData - the data returned above
var_dump($jsonData);
returns this:
object(Illuminate\Http\JsonResponse)#320 (10) { ["jsonOptions":protected]=> int(0) ["data":protected]=> string(28) "{"status":"Group not found"}" ["callback":protected]=> NULL ["encodingOptions":protected]=> int(15) ["headers"]=> object(Symfony\Component\HttpFoundation\ResponseHeaderBag)#317 (5) { ["computedCacheControl":protected]=> array(1) { ["no-cache"]=> bool(true) } ["cookies":protected]=> array(0) { } ["headerNames":protected]=> array(3) { ["cache-control"]=> string(13) "Cache-Control" ["content-type"]=> string(12) "Content-Type" ["date"]=> string(4) "Date" } ["headers":protected]=> array(3) { ["cache-control"]=> array(1) { [0]=> string(8) "no-cache" } ["content-type"]=> array(1) { [0]=> string(16) "application/json" } ["date"]=> array(1) { [0]=> string(29) "Tue, 17 Jun 2014 19:03:33 GMT" } } ["cacheControl":protected]=> array(0) { } } ["content":protected]=> string(28) "{"status":"Group not found"}" ["version":protected]=> string(3) "1.0" ["statusCode":protected]=> int(200) ["statusText":protected]=> string(2) "OK" ["charset":protected]=> NULL }
Take a look at ["data":protected]=> string(28) "{"status":"Group not found"}"
. The data is protected for some reason and doesn't appear when I decode the JSON. How do I "unprotect" it (make it publicly available)?