title: Call to a member function getClientOriginalName() on null on multiple file upload
body: <p>I want to upload multiple files to directory and  inert into table, but I am getting the following error:</p>
  
  <pre><code>Call to a member function getClientOriginalName() on null
  </code></pre>
  
  <p>Below is my code:</p>
  
  <p><strong><em>controller</em></strong></p>
  
  <pre><code>$editLogistic = LogisticTransaction::find($id);
  $batchid = $editLogistic-&gt;id;
  
  if(Input::file('attachment')) {
      foreach(Input::file('attachment') as $image) {
          $filename =  date("Ymdhis")."-".uniqid();
          $filename = $filename.".".$image-&gt;getClientOriginalName();
          $path=public_path('logistic/images');
          $x= $image-&gt;move($path,  $filename);
  
          DB::table('logistic_batch_attachment')-&gt;insertGetId(array(
              'batch_id'     =&gt;  $editLogistic-&gt;id,
              'filename'     =&gt;  $filename,
              'path_to_file' =&gt;  $path,
          ));
      }
  }
  </code></pre>
  
  <p><strong><em>view</em></strong></p>
  
  <pre><code>{{
      Form::open(array(
          'url'=&gt;'jlogistic/edit/'.$logistic-&gt;id,
          'class' =&gt; 'form-horizontal',
          'files' =&gt; true,
          'enctype'=&gt;'multipart/form-data','method'=&gt;'post'
      ))
  }}
  
  &lt;div class="form-group increment"&gt;
      &lt;label  class="col-lg-2 control-label"&gt;Attachment&lt;/label&gt;
          &lt;div class="col-lg-3"&gt;
              &lt;input type="file" name="attachment[]" class="form-control"&gt;
          &lt;/div&gt;
          &lt;div class="input-group-btn"&gt; 
              &lt;button class="btn btn-success" type="button"&gt;
                  &lt;i class="glyphicon glyphicon-plus"&gt;&lt;/i&gt;Add
              &lt;/button&gt;
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I am getting this error but file are moving to folder and inserting into database:</p>
  
  <blockquote>
    <p>Call to a member function getClientOriginalName() on null</p>
  </blockquote>