https://twill.io logo
Hello! Is it possible to write validation rules f...
# ❓questions
k
Hello! Is it possible to write validation rules for a specific crop of a
medias
form field? my usecase would be validating that a block-editor block with a medias form field, has at least X amount of images attached in a single
medias
form field Something along the lines of this:
Copy code
php
@twillBlockValidationRules([
    'medias.cover' => [
        'required',
        'min:12'
    ],
])
EDIT: Nevermind I figured out how to target the medias.cover properly. Ended up using this:
Copy code
php
@twillBlockValidationRules([
    'cover' => [
        'required',
        'array',
        'between:12,16'
    ],
])
where the medias form field name is
cover