I have an array of objects with different, dynamic parameters. And I'm trying to find a way to validate it based on the object type value. Is there any way to make it with the FormRequest?
[
{
type: “link”,
url: “https://link.com”,
...
},
{
type: “image”,
id: “drre-ggre-765”,
image: “url”
...
}
]
$this->{'validate' . ucwords($object->type)}($object);which would then call$this->validateImage($object)for example.