I am building a REST API using Laravel framework and the Dingo API library. Everything works well except that I don't know how I can customize the default error handler when exception happens.
For example, when my code run error, the response is simply this:
{
"message": "Error",
"status_code": 500
}
How can I change this response to my own format?
'errorFormat' => [ 'message' => ':message', 'errors' => ':errors', 'code' => 0, 'status_code' => ':status_code', 'result' => ':errors', 'debug' => ':debug', ],