I am building a form which uploads multiple files ,its working fine but the problem is my validation message ,my validation is checking the mime type of the file .
suppose the uploaded file with name filename
The validation message : The file.0 must be a file of type: pdf, doc, docx, jpeg, jpg, png, bnp.
i want to change it to The filename must be a file of type: pdf, doc, docx, jpeg, jpg, png, bnp.
My form :
{!! Form::open(['route' => ['file.store'], 'method'=> 'POST', 'id' => 'file_form','files' => 'true']) !!}
{!!Form::FILE('file[]', ['id' => 'file','multiple' =>true])!!}
<button type="submit" name="submit">save</button>
{!! Form::close() !!}
my formRequest validation
foreach ($this->file as $key => $val)
{
$rules['file.' . $key] = 'mimes:pdf,doc,docx,jpeg,jpg,png,bnp|extension|max:10240'
}
return rules;
file.1
I Mean for other – Niklesh Raut