title: Laravel - Upload multiple files from request and move them to a folder
body: <p>So I tried file uploading using Input but sadly failed. I am trying to use <code>Request</code> to do it but I get the follow error: </p>
  
  <blockquote>
    <p>Call to a member function move() on string</p>
  </blockquote>
  
  <p>blade:</p>
  
  <pre><code>&lt;input type="file" name="productImage[]" id="" multiple&gt;
  </code></pre>
  
  <p></p>
  
  <p>controller:</p>
  
  <pre><code>public function addProduct(Request $request)
  {
      $this-&gt;validate($request, [
          'title' =&gt; 'required',
          'description' =&gt; 'required',
          'details' =&gt; 'required',
          'price' =&gt; 'required',
          'subcategory' =&gt; 'required',
          'color' =&gt; 'min:1',
          'size' =&gt; 'min:1',
          'productImage' =&gt; 'min:1'
      ]);
  
      $product = new Product();
      $product-&gt;subcategory_id = $request['subcategory'];
      $product-&gt;gender_id = $request['gender'];
      $product-&gt;title = $request['title'];
      $product-&gt;description = $request['description'];
      $product-&gt;details = $request['details'];
      $product-&gt;price = $request['price'];
      $product-&gt;save();
  
      foreach ($request['color'] as $color_id) {
          $color = Color::find($color_id);
          $product-&gt;colors()-&gt;save($color);
      }
  
      foreach ($request['size'] as $size_id) {
          $size = Size::find($size_id);
          $product-&gt;sizes()-&gt;save($size);
      }
  
      foreach ($request-&gt;file('productImage') as $productImage) {
          $file = $productImage;
          $file-&gt;move('images', $file-&gt;getClientOriginalName());
          $image = new Image();
          $image-&gt;product_id = $product-&gt;id;
          $image-&gt;path = $file-&gt;getClientOriginalName();
          $product-&gt;images()-&gt;save($image);
      }
  
      return redirect()-&gt;route('admin.products')-&gt;with(['added' =&gt; 'Продукт добавен успешно!']);
  }
  </code></pre>
  
  <p>I need to get my files and their names and upload them to my images folder.</p>