title: Laravel move image from one folder to another with button
body: <p>I'm new to Laravel and I'm trying to figure out the appropriate way of moving an image with the click of a button. I currently have a folder containing unverified images, and these are displayed on a control panel where admins can approve them before they're displayed on another page.</p>
  
  <p>My current solution is to add a link below the image called 'Accept Image', which passes the image name as a GET parameter to another file. This is sent to another page that moves the image from the unverified folder to the verified folder, and then the admin gets redirected back to the control panel. The solution works just fine, but I'm not sure if this is a safe/good way to do it.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;a href="/accept/upload?fileName='.$fileName.'"&gt;Accept Image&lt;/a&gt;
  </code></pre>
  
  <p>And the /accept/upload looks like this:</p>
  
  <pre><code>$fileName = htmlentities($_GET['fileName']);
  $destinationPath = 'verified-images/';
  $sourcePath = 'unverified-images/';
  
  if (File::move($sourcePath.$fileName, $destinationPath.$fileName))
  {
    Session::flash('success', 'Success'); 
    return Redirect::to('controlpanel');
  } 
  else
  {
    Session::flash('error', 'Error');
    return Redirect::to('controlpanel');
  }
  </code></pre>