title: Laravel Dingo API - Only log 500 error, never send error details via api?
body: <p>I made the below controller to demonstrate the issue of handling 500 errors I am having with dingo api in laravel. I want to be able to detect when a 500 error will be thrown so it never makes it to the client (as it is too much details to share with the client and they should only be logged by Laravel).</p>
  
  <p>The method<code>getUser()</code> returns a 500 error intentionally due to the typo <code>firsgt()</code></p>
  
  <pre><code>class TestController extends Controller {
    public function getUser() {
      $data = User::firsgt(); //returns 500 error
      return $data;
    }
  }
  </code></pre>
  
  <p>This is what the client sees:
  <a href="https://i.stack.imgur.com/h4iVa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h4iVa.png" alt="enter image description here"></a></p>
  
  <p>In my controllers, I handle errors manually by returning a success/error json response from within the controllers, but if an error occurs that I did not expect, the api returns it and it has too much details for the client to see. Instead, these unexpected errors should bubble up to some sort of handler to return a generic error occurred response. In Laravel, setting <code>APP_DEBUG = false</code> in <code>.env</code> works for laravel (but not for dingo api), this has no effect and the full error is returned to the client. Looking for a safety net for errors that slip through the cracks.</p>
  
  <p>How can we return an error message like 'Error occurred' instead of the too much details for client 'Call to undefined method App\User::firsgt()'?</p>
  
  <p>Note: I don't want to handle it one by one for each controller method, but instead capture any 500 before it is returned to client, and return the custom 500 generic message 'Error occurred'</p>