Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Nihir's avatar
Level 50

Laravel Voyager accept only 2 image validation?

Hi Folks I created the project & used Voyager as a Laravel admin. There is bread Called Page & in that bread, there is a section called Image I added the type as a multiple image which accept multiple images but I want to add validation that image takes max 2 images no more. If there is already 1 image & user tried to add the 2 more image than it will show the error.. I tried Method:

{
    "image": "max:2"
}
{
    "validation": {
        "rule": "array|max:2"
    }
}
{
    "validation": {
        "image": "array|max:3"
    }
}

I added this type of validation but i when I tried to upload 5 images it accepted it the error show the error called that the image size must be in 2 kilobytes Now how can I fix this validation.

0 likes
0 replies

Please or to participate in this conversation.