I have an input field who allaow peoples to upload files. I want that they can upload, word files like doc, and files like csv,xlsx.
When i try with a .doc no proble
Ok, my fault. I had tried another solution, found on this website and it worked. Thanks for help Odin. It was my first question on this website. I am gonna see if I can help someone now. I post code for solution for someone in need :).
$validator = Validator::make(
[
'file' => $request->file,
'extension' => strtolower($request->file->getClientOriginalExtension()),
],
[
'file' => 'required',
'extension' => 'required|in:doc,csv,xlsx,xls,docx,ppt,odt,ods,odp',
]
);