title: How to send Laravel error responses as JSON
body: <p>Im just move to laravel 5 and im receiving errors from laravel in HTML page. Something like this:</p>
  
  <pre><code>Sorry, the page you are looking for could not be found.
  
  1/1
  NotFoundHttpException in Application.php line 756:
  Persona no existe
  in Application.php line 756
  at Application-&gt;abort('404', 'Person doesnt exists', array()) in helpers.php line 
  </code></pre>
  
  <p>When i work with laravel 4 all works fine, the errors are in json format, that way i could parse the error message and show a message to the user. An example of json error:</p>
  
  <pre><code>{"error":{
  "type":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException",
  "message":"Person doesnt exist",
  "file":"C:\\xampp\\htdocs\\backend1\\bootstrap\\compiled.php",
  "line":768}}
  </code></pre>
  
  <p>How can i achieve that in laravel 5.</p>
  
  <p>Sorry for my bad english, thanks a lot.</p>