title: Laravel 4. Saving image with Dropzone to Database.
body: <p>Hi I have problem with upload images to databases and folders.
  I have dropzone and intervention image</p>
  
  <p>Want to load images thrown by the user to the database. It will be a few pictures, not one.</p>
  
  <p>Database connection I have everything done, because on one image without dropzone worked.</p>
  
  <p>Problems:
  <strong>Call to a member function getRealPath() on a non-object</strong></p>
  
  <p>my controller</p>
  
  <pre><code> $image = Input::hasFile('image');
              $destinationPath = 'uploads';
              $filename = str_random(12);
              // $filename  = time() . '.' . $image-&gt;getClientOriginalExtension();
  
              $path = public_path('img/offers/' . $filename);
              Image::make($image-&gt;getRealPath())-&gt;
              resize(null, 600, function ($constraint) {
                  $constraint-&gt;aspectRatio();
                  $constraint-&gt;upsize();
                  })
              -&gt;insert('img/watermark.png', 'bottom-left', 10, 10)
              -&gt;save($path);
  </code></pre>
  
  <p>my view:</p>
  
  <pre><code>            {{ Form::open(array('url'=&gt;'profile/offers/create', 'method' =&gt; 'POST','class'=&gt;'dropzone', 'file'=&gt;true)) }}
  
      &lt;p&gt;
        {{ Form::label('Title:') }}
        {{ Form:: text('title', null, array('class' =&gt; 'form-control', 'required' =&gt; '')) }}
      &lt;/p&gt;
  
      &lt;p&gt;
          {{ Form::label('image', Select images') }}
          {{ Form::file('image', array('multiple')) }}
      &lt;/p&gt;
  
  
  
  
      {{ Form::submit('Create offers', array('class'=&gt;'secondary-cart-btn')) }}
      {{ Form::close() }}
  </code></pre>