title: Laravel - How to change upload file path
body: <p>I need to upload images to folder project images.</p>
  
  <p>My project structure folder in share host is this:</p>
  
  <pre><code>- css
  - images
  - fonts
  - js
  - laravel-code
  - .htaccess
  </code></pre>
  
  <p>Inside <code>laravel-code</code> folder are the remaining files.</p>
  
  <p>The site work well, show images well but when i upload a new image it save the image in <code>laravel-code/</code> and create this folders <code>public/images</code> ...</p>
  
  <p>I want to save images in image folder at root directory.</p>
  
  <p>How can I do that?</p>
  
  <p>When I do an upload file it detects if it was a pdf or other file; if it was pdf saves file on storage folder, if it other file (images) save in images folder. This is my code... I think I cannot use <code>public_path</code></p>
  
  <pre><code>if (false === stripos($name, '-pdf')) {
      $basePath = trim(public_path(), '/');
      $newPath = trim(public_path('images'), '/');
  } else {
      $basePath = trim(storage_path(), '/');
      $newPath = trim(storage_path(), '/');
  }
  </code></pre>