validator icon indicating copy to clipboard operation
validator copied to clipboard

Array of Object validation

Open GoldraK opened this issue 1 year ago • 2 comments

Hello again,

I continue using your library in my projects and now I have to validate an array of objects.

In Laravel it is done as follows.

$rules = [ 'schedules' => 'required|array', 'schedules.*.name' => 'required|string|max:255', 'schedules.*.description' => 'required|string|max:1000', ];

Is there any possibility of implementing it?

Thank you.

GoldraK avatar Jun 26 '24 10:06 GoldraK

Hello @GoldraK !

Sorry for the late response, I was on holiday. And thanks for the feedback. We can do it, I guess. Let me work on it this week. ☺️

ozziest avatar Jul 07 '24 13:07 ozziest

@GoldraK , I just wanted to inform you that I didn't forget your request. :) I am still working on it, but finding time to work on an open-source project is not easy.

ozziest avatar Sep 27 '24 21:09 ozziest

@GoldraK , finally, the new version has been released. You can use it on object and array, with nested support.

https://validator.axe-api.com/getting-started.html#nested-data-validation

ozziest avatar Jan 13 '25 18:01 ozziest

Thank you very much.

I'll update the package right away and get it up and running.

GoldraK avatar Jan 14 '25 11:01 GoldraK