How to validate a file type in laravel
laravel 8
\request ()->validate(['photo' => 'mimes:jpg,bmp,png']);
official documentation link
Does it have to just be .jpg? If so then something like:
'image' => 'required|mimes:jpeg'
Documentation: http://laravel.com/docs/5.1/validation#rule-mimes
If it can be any type of image, then:
'image' => 'required|image'
Documentation: http://laravel.com/docs/5.1/validation#rule-image