title: Extract statusCode from json response in Laravel
body: <p>Working in Laravel 5.4</p>
  
  <p>After deleting an image (in my ImageRepository) I send a Json response back to my Controller (where I called the ImageRepository). Now I simply want to check what status code I am getting back to further build on that. </p>
  
  <pre><code>return Response::json([
      'error' =&gt; false,
      'code'  =&gt; 200,
      'message' =&gt; 'Image was deleted!'
  ], 200);
  </code></pre>
  
  <p>When I receive this response in my Controller and I <code>dd();</code> it I see this:</p>
  
  <pre><code>JsonResponse {#461 ▼
    #data: "{"error":false,"code":200,"message":"Image was deleted!"}"
    #callback: null
    #encodingOptions: 0
    +headers: ResponseHeaderBag {#459 ▶}
    #content: "{"error":false,"code":200,"message":"Image was deleted!"}"
    #version: "1.0"
    #statusCode: 200
    #statusText: "OK"
    #charset: null
    +original: array:3 [▶]
    +exception: null
  }
  </code></pre>
  
  <p>I only need to extract the statusCode so that I can send the correct notification to the user (image deleted, image not found, imaage ...)</p>
  
  <p>Can't believe I cannot find a solution for this anywhere.<br>
  Thanks</p>