Always Render API Exceptions as JSON in Laravel - Laravel News
Laravel gives you a handy way to render all exceptions for API requests as JSON without any custom middleware. This bootstrap configuration tip makes it easy to ensure API exceptions render as JSON.