To validate mime type of a file input in Laravel you can use the mimes
rule. Remember to match the mime type detected with the actual mime of file you provide. It may vary on different servers.
For example, you want to enable adding and word document in you form:
1) in config/mimes.php
add the below mime types:
'doc' => array('application/msword', 'application/vnd.ms-office'),
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'),
2) in your validation $rules
add the following elements:
'file' => 'required|max:10000|mimes:doc,docx' //a required, max 10000kb, doc or docx file