title: Laravel 4.2 Storing image path to database
body: <p>I'm having trouble to store the correct image path of a file upload to the database. </p>
  
  <p>this is my code: </p>
  
  <pre><code>public function store()
      {
          $input = Input::all();
  
          try
          {
              $this-&gt;modelForm-&gt;validate($input);
  
              if ( Input::hasFile('thumbnail')) {
  
                  $file = Input::file('thumbnail');
                  $name = time().'-'.$file-&gt;getClientOriginalName();
                  $file = $file-&gt;move('uploads/', $name);
                  $input['file'] = $file-&gt;getRealPath();
              }
  
              $model = new Model($input);
              $model-&gt;save();
  
              Redirect::back();
  
          }
          catch (FormValidationException $e)
          {
              return Redirect::back()-&gt;withInput()-&gt;withErrors($e-&gt;getErrors());
          }
      }
  </code></pre>
  
  <p>so... this is what i'm storing with this code:</p>
  
  <pre><code>/home/vagrant/code/website/public/uploads/1411468959-Bia.jpg
  </code></pre>
  
  <p>and this is what I need to store i think: </p>
  
  <pre><code>public/uploads/1411468959-Bia.jpg
  </code></pre>