Q:

Upload multiple images using Dropzone plugin with Laravel validation

How to validate multiple images uploaded through dropzone plugin with laravel 5.2
I googled and test many solutions , but really does not work .
Your help is appreciated.
<?php

namespace App\Http\Controllers;

use App\Bill;
use App\Http\Requests;
use Illuminate\Http\Request;
use Image;

class OrderBillController extends Controller
{
    public function saveFile(Request $request, $id)
    {
        //dd($request->all()); // testing

        // Here I need to vaidate multiple Files

        $this->validate($request, [
            $request->file('file') => 'image|max:3000'
        ]);

        $file = $request->file('file');
        for ($i = 0; $i < count($file); $i++) {
            $name = $id . '_' . time() . '_' . rand(11, 99) . '_' . $file[$i]->getClientOriginalName();
            if ($file[$i]->move(public_path() . '/bills', $name)) {
                Bill::create(['order_id' => $id, 'name' => $name]);
                $img = Image::make(public_path() . '/bills/' . $name)
                    ->resize(300, 200)
                    ->save(public_path() . '/bills/' . 'tn_' . $name);
                Bill::create(['order_id' => $id, 'name' => ('tn_' . $name)]);

            }
        }
    }
}

After first comment i tried this
    public function saveFile(Request $request, $id)
{
    //dd($request->all());
    $this->validate($request, [
        $request->file('file') => 'image|max:3000'
    ]);

    $file = $request->file('file');
        $name = $id . '_' . time() . '_' . rand(11, 99) . '_' . $file->getClientOriginalName();
        if ($file->move(public_path() . '/bills', $name)) {
            Bill::create(['order_id' => $id, 'name' => $name]);
            $img = Image::make(public_path() . '/bills/' . $name)
                ->resize(300, 200)
                ->save(public_path() . '/bills/' . 'tn_' . $name);
            Bill::create(['order_id' => $id, 'name' => ('tn_' . $name)]);
        }
    }

A:

As mentioned in the comment, Dropzone only uploads 1 file at a time, so you are only validating a single file. You're validation code should be 
$this->validate($request, [
        'file' => 'image|max:3000'
    ]);

You also have no need for your 'for' loop as there are not multiple files being sent in the request. You're just processing one image

