laravel-realworld-example-app
laravel-realworld-example-app copied to clipboard
Customizing the error format
trafficstars
Hi,
I want to know where can I find the code that customizes the JSON error from
[{
"email": [
"The email field is required."
],
"password": [
"The password field is required."
]
}].
To
[{
"errors": {
"email": [
"field is required."
],
"password": [
"field is required."
]
}
}]
Hi, it's a method respondError() located in App/Http/Controllers/Api/ApiController.php