Wie überprüfe ich, ob mehrere Bilder in laravel 5.3 hochgeladen wurden?

Ich habe eine Eingabe

    <input type="file" name="image[]" multiple="multiple" />

und Reglerfunktion

public function upload(Request $request)
{
    $user_id = Auth::user()->id;

    foreach ($request->image as $image)
    {
        $this->validate($request,[
        'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048'
    ]);
        $imageName = mt_rand() .time().'.'.$image->getClientOriginalExtension();
        $img = Image::make($image->getRealPath());
        $img->resize(100, 100, function ($constraint) {
                                    $constraint->aspectRatio();
                    })->save(public_path('images/thumbs').'/'.$imageName);
        $image->move(public_path('images'), $imageName);
    }
}

Aber die ganze Zeit Validator gibt mir Fehler, dass

    The image must be an image.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage