I use form request in rules I write:
'photo' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
Why I get the message The photo must be an image. ? How to make this field not mandatory, but when choosing what to do these checks?

    1 answer 1

    Add nullable :

     'photo' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048' 
    • Thank you very much. - Andrii