I am writing Validator in Laravel, and so I am getting json format request.
I have written validate logic for main json's fields such as id, name... Now I have items array of objects in json, and I need to validate each item from this array which is passed.
Here's example of json request: https://api.myjson.com/bins/ob3lh
And here's my validator so far:
private function update()
{
return [
'id' => 'required',
'place_id' => 'required',
'place_table_id' => 'required',
'user_id' => 'required',
'seen' => 'required',
'state' => 'required',
'number' => 'required',
'date' => 'required',
'price' => 'required',
'table_number' => 'required',
'note' => 'required',
];
}
How can I add simply for example nested validator which will validate each of items object?