title: Laravel : To rename an uploaded file automatically
body: <p>I am allowing users to upload any kind of file on my page, but there might be a clash in names of files. So, I want to rename the file automatically, so that anytime any file gets uploaded, <strong>in the database and in the folder after upload</strong>, the name of the file gets changed also when other user downloads the same file, renamed file will get downloaded.
  I tried:</p>
  <pre><code>if (Input::hasFile('file')){
          echo &quot;Uploaded&lt;/br&gt;&quot;;
          $file = Input::file('file');
          
          $file -&gt;move('uploads');
          $fileName = Input::get('rename_to');
          
      }
  </code></pre>
  <p>But, the name gets changed to something like:</p>
  <blockquote>
  <p>php5DEB.php</p>
  <p>phpCFEC.php</p>
  </blockquote>
  <p><strong>What can I do to maintain the file in the same type and format and just change its name?</strong></p>
  <p><strong>I also want to know how can I show the recently uploaded file on the page and make other users download it??</strong></p>