Validating multiple files in array
<p>I need to validate multiple uploaded files, making sure they are of a specific type and under 2048kb. The below doesn't appear to check all files in the array 
'files' and just presumes the posted files of invalid mime type as it seems to be checking the array object and not its contents. </p>

<pre><code>public function fileUpload(Request $request)
    {

       $validator = Validator::make($request-&gt;all(), [
            'files' =&gt; 'required|mimes:jpeg,jpg,png',
        ]);

        if ($validator-&gt;fails())
        {
            return response()-&gt;json(array(
                'success' =&gt; false,
                'errors' =&gt; $validator-&gt;getMessageBag()-&gt;toArray()

            ), 400);             }

}
</code></pre>