How to validate images outside of blocks. #1947
Unanswered
Tom-revere
asked this question in
Q&A
Replies: 1 comment
-
Hey @Tom-revere, You can use the following (replace cover with your field name). public function rulesForUpdate()
{
return ['medias.cover' => 'required|array|min:1'];
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an image field I want to make required. As it is outside of a block, I am adding this to the Request.php file
However when saving, I get this error
422 Unprocessable Content
Is there any way to validate media fields outside of a block?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions