title: Laravel 5.1 file upload unique name
body: <p>My controller code where i store the file name into a database table and also moving the file to a folder.</p>
  
  <p>The issue is that i am storing the original name of a file in database table, in contrast i am moving files with <code>uniqueid()</code> and <code>time()</code> . It will arise issues in future. because in database table file name and moved file are with different names. </p>
  
  <p>What i want is to store the file name into database table and move the file to folder with  with <code>uniqueid()</code> and <code>time()</code>. </p>
  
  <p>Code :</p>
  
  <pre><code>if(Input::hasFile('profile_pic')){
              $pic = Input::file('profile_pic');
              $mobile-&gt;photo1 = $pic[0]-&gt;getClientOriginalName();
              $mobile-&gt;photo2 = $pic[1]-&gt;getClientOriginalName();
              $mobile-&gt;photo3 = $pic[2]-&gt;getClientOriginalName();
              $mobile-&gt;photo4 = $pic[3]-&gt;getClientOriginalName();
              $mobile-&gt;photo5 = $pic[4]-&gt;getClientOriginalName();
  
                  foreach ($pic as $k=&gt;$file){
                      if(!empty($file)){
                          $file-&gt;move(public_path() . '/uploads/', time() . uniqid() . '-' . $k . '-laptop');
                      }
                  }
          }
  </code></pre>