title: Laravel 5 The file "" does not exist
body: <p>I'm trying to upload a file. Heres my controller</p>
  
  <pre><code>if ($request-&gt;hasFile('photo')) {
              $destinationPath = 'images/quizzes/'; // upload path
              $extension = $file-&gt;getClientOriginalExtension(); // getting image extension
              $fileName = rand(11111,99999).'.'.$extension; // renameing image
  
              $request['photo'] = $fileName;
              $request['image_path'] = $destinationPath;
  
              $file-&gt;move($destinationPath, $fileName); // uploading file to given path
  
              $quiz = Quiz::create($request-&gt;all())
  
  
          }else{
              \Session::flash('flash_message_delete','Please select files to upload.');
              return redirect()-&gt;back();
          }
  </code></pre>
  
  <p>It gives me <code>FileNotFoundException in File.php line 37:The file "" does not exist</code>. This was working fine the other day, idk what happes..i try to interchange the arrangement like:</p>
  
  <pre><code>$destinationPath = 'images/quizzes/'; // upload path
              $extension = $file-&gt;getClientOriginalExtension(); // getting image extension
              $fileName = rand(11111,99999).'.'.$extension; // renameing image
  
              $request['photo'] = $fileName;
              $request['image_path'] = $destinationPath;
  
              $quiz = Quiz::create($request-&gt;all());
  
              $file-&gt;move($destinationPath, $fileName); // uploading file to given path
  </code></pre>
  
  <p>I wont have error like this, and it save to the database, THE PROBLEM is the <code>photo field</code> instead of the <code>$filename</code> it has wierd <code>/tmp/somestrings</code> inserted.</p>