title: How to add HTTP Status code and status text in to response with ellipsesynergie/api-response In Laravel 5?
body: <p>We will need to add status code in to the response.</p>
  
  <p>Like </p>
  
  <pre><code>public function withArray(array $array, array $headers = array()) {
  if ($this-&gt;statusCode == '200') {
  $array = array('code' =&gt; $this-&gt;statusCode , 'success' =&gt; TRUE) + $array;
  } else {
  $array = array('code' =&gt; $this-&gt;statusCode, 'success' =&gt; FALSE) + $array;
  }
  return response()-&gt;json($array, $this-&gt;statusCode, $headers);
  }
  </code></pre>
  
  <p>For now, we had modified library code on <code>"ellipsesynergie/api-response/src/Laravel/Response.php"</code>.</p>
  
  <p>But I feel. Its not good way.</p>
  
  <p>Could you please suggest me how can i add this to all response without change library code ?</p>
  
  <p>Or Is there any way to add the status code from controller for final response.</p>
  
  <p>Actually, we will need final response like "<a href="http://screencast.com/t/nmWF7PYU" rel="nofollow">http://screencast.com/t/nmWF7PYU</a>".</p>
  
  <p>Please help us on this. </p>
  
  <p>Thanks in advance</p>