I can't figure how to do this. I use FormRequest in my controller so the validation happens before i enter the controller's action method. I want to edit the json responce from my Laravel API request validation. I get something like that:
{
"name": [
"The name field is required."
],
"username": [
"The username field is required."
],
"password": [
"The password field is required."
]
}
and i need to make it like that:
{
"errors": [
"The name field is required.",
"The username field is required.",
"The password field is required."
]
}
before it goes to the client that uses the API. Is there any way to do that?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community