[Vuejs]-Uploading Multiple Image in Laravel and vue js

0👍

if you want to upload multiple images you have to do loop, you can try this :

    public function multipleupload(Request $request)
    {
        $input = $request->all();

        request()->validate([

            'image' => 'required',

        ]); 

         if($request->hasfile('image'))
         {
            foreach($request->file('image') as $image)

            {
                $imageName=file_name =$image->getClientOriginalName();
                $image->move(public_path().'/images/', $imageName);  
                $insert['image'] = "$imageName";

            }
         }       

        Image::create($insert);

        return back()

                ->with('success','Multiple Image Upload Successfully');
    }

Leave a comment