title: How do I replace a file on Laravel's file system
body: <p>I have a form which accepts a resume, and I would like the user to be able to upload files. I got this route to work, however, I want to replace the files uploaded by that user (I rename the file with their last name and the current time). My code is below:</p>
  
  <pre><code>$file = $request-&gt;file('cv');
  $fileName = $user-&gt;id . "+" . date("Y-m-d H:i:s");
  $destinationPath = config('app.CVDestinationPath') . "/" . $fileName . "." . $file-&gt;getClientOriginalExtension();
  $uploaded = Storage::put($destinationPath, file_get_contents($file-&gt;getRealPath()));
  if ($uploaded) { //update the database
     dd("DONE"); 
  }
  </code></pre>
  
  <p>So if a user has an <code>id</code> of 2, and he uploads two files. I will have two files associated with that user. I want to replace any file with the <code>id</code> of 2 if it exists. Also what is the max file size upon a post request I can store? 
  Can anyone provide any guidance?</p>