$error->has() for ANY errors in input array

Posted 2 years ago by AdamEsterle

I want to check, on my view, if there are any errors.

Normally: $errors->has(name-of-field) Or with an array: $errors->has(array.index)

How do I check if there was an error for ANY of my input arrays?

I want so display an error if $error->has('user.0') || $error->has('user.1') || ... But I do not know how many users will be validated, I just want to display the error if user.any has an error

I tried: $errors->has('user.*') , but that did not work

Any ideas?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.