1

validation to input multiple files.

This is my validator script :

   $validator = Validator::make($request->all(), [
                    'raport1.*' => 'required|mimes:jpeg,pdf,png|max:1024', 
                    'raport2.*' =>'required|mimes:jpeg,pdf,png|max:1024'

   ]);

and this script multiple select form:

<input id="raport1" name="raport1[]" type="file"  class="btn-success" multiple />

and my form format:

<form name="store" id="store" class="form-horizontal" role="form" method="POST" action ="{{ url('/storeform') }}" enctype="multipart/form-data" files ="true">

the validator can not check my input file format. please help me, thnks

Siti Rahmah
  • 267
  • 1
  • 3
  • 15
  • Possible duplicate of [Validating multiple files in array](https://stackoverflow.com/questions/38326282/validating-multiple-files-in-array) – Rahman Qaiser Apr 02 '18 at 10:11
  • already successfully, but now the problem is I can not print error messages. This script error on the blade: {{$errors->insert-> first (' raport1 ')}} – Siti Rahmah Apr 02 '18 at 10:26
  • Check https://stackoverflow.com/questions/44362031/multiple-file-upload-validation-in-laravel – Nirali Apr 02 '18 at 10:33

0 Answers0