Level 50
Hey @nikunj001
The only ok way I saw to do this was to decode json to array and then validate the data. There is no nice "laravel" way to do it straight away with json as far as I'm aware.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
These are my API parameters
"feed_back":[
{
"feedId": "1",
"rating": "1",
"answer": "nice"
},
{
"feedId": "2",
"rating": "2",
"answer": "nice"
},
{
"feedId": "3",
"rating": "3",
"answer": ""
}
]
For example, if I am having one of the parameters missing in the third response. so how to provide validation in this type of parameter. I can do the validation using for loop. But, I am looking for a more compact way for this type of validation.
Please or to participate in this conversation.