title: Laravel Image intervention showing me Call to a member function getClientOriginalName() on a non-object Laravel
body: <p>I am using Laravel <a href="http://image.intervention.io/getting_started/installation#laravel" rel="nofollow">Image Intervention</a> Package with drop-zone plugin. And for sure I have installed it properly. When I try to upload images and then submit the form its showing me the following error message <br /> <br />
  <strong>"Call to a member function getClientOriginalName() on a non-object"</strong></p>
  
  <p>Even this error message showing me if i blank this input field form. In that case it is expected to me  not showing me any error message as it is not mandatory field to submit the form But it did.</p>
  
  <p>I have two query. </p>
  
  <p>1) what's going wrong in my code <br/><br/>
  2) Right now I am trying to upload single image. For multiple images I want to store the files info as an array. In that case what would my code in controller.</p>
  
  <p>Here is my live link you can check from here 
  <a href="http://thetoppinghouse.com/laravel/public/admin/index/create" rel="nofollow">http://thetoppinghouse.com/laravel/public/admin/index/create</a> <br/><br/>
  <a href="http://laravel.io/bin/Jxmzo" rel="nofollow">http://laravel.io/bin/Jxmzo</a></p>
  
  <p>Here is my controller code </p>
  
  <pre><code>public function store()
      {
          $validator = Validator::make($data = Input::all(), Index::$rules);
          if ($validator-&gt;fails())
          {
              return Redirect::back()-&gt;withErrors($validator)-&gt;withInput();
          }
  
          if ($validator-&gt;passes()) {
              $index = new Index;
              $index-&gt;name = Input::get('name');
              $index-&gt;category_ID = Input::get('category_ID');
  
              $files = Input::file('files');
              $filename = date('Y-m-d-H:i:s')."-".$files-&gt;getClientOriginalName();
              $path = public_path('img/index/' . $filename);
              Image::make($files-&gt;getRealPath())-&gt;save($path);
              $index-&gt;files = 'img/index/'.$filename;
              $index-&gt;save();
  
              return Redirect::route('admin.index.index')-&gt;with('message', 'Index Created');
  
          }
  
      }
  </code></pre>
  
  <p>// Form Code </p>
  
  <pre><code>&lt;ul class="post-list"&gt;
       &lt;li&gt;
           {{ Form::label('parent_ID', 'Category') }}
           {{ Form::select('parent_ID',Category::lists('category_name','id'),Input::old('category'),array('class' =&gt; 'form-control input-sm', 'id' =&gt; 'parent_ID')) }}
        &lt;/li&gt;
  
         &lt;li&gt;
          {{ Form::label('name', 'Index Name') }}
          {{ Form::text('name', null, array( 'class' =&gt; 'form-control input-sm', 'placeholder' =&gt; 'Name' )) }}
          {{ $errors-&gt;first('name', '&lt;p class="error"&gt;:message&lt;/p&gt;' ) }}
        &lt;/li&gt;
  
  
          &lt;li&gt;
            {{ Form::label('image', 'Cover Image') }}
          &lt;/li&gt;
  
             &lt;div class="dropzone" id="DropzoneArea"&gt;
                  &lt;div class="fallback"&gt;
                     &lt;input name="files" type="file" id="files" multiple&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
            {{ Form::submit('Save') }}
          &lt;/li&gt;
  &lt;/ul
  </code></pre>