The difference is mimes takes a list of file extensions, whereas mimetypes takes a list of mimetypes. Under the hood, the logic defers to the same Mimetypes Symfony class to guess the mimetype from the uploaded file.
May 7, 2025
2
Level 6
What's the difference of mimes and mimetypes in validations?
I couldn't make the difference out of mimes and mimetypes
'photo' => 'mimetypes:image/png',
'photo' => 'mimes:png',
I have a photo.png file that I changed its extension to .mp4, and both of the validation accepted the file. Then, I tried an svg file with a png extension and both rejected it.
Since both of the rules read the file, what's the difference between the two and why should I use one than the other?
Please or to participate in this conversation.