title: File upload does not work Laravel
body: <p>I'm trying to upload an image from a form and store it in my laravelproject. The folder I want to store these pictures in is calles battlePics and I made this folder on the assets level. The actual problem is that $filename remains empty after this function. This is my controller:</p>
  
  <pre><code> if (Input::hasFile('file')) {
        $file = input::get('file');
  
  
        $string = str_random(40);
  
        $filename = hash("md5", $string) . $file-&gt;getClientOriginalName();
        $file-&gt;move('battlePics', $filename);
  
        $battle-&gt;picture = $filename;
  
  
  
      }
  
      $battle-&gt;save();
  </code></pre>
  
  <p>I use the md5 hash to create different filenames to avoid errors when an image with the same name is uploaded. Here is the view of my form:</p>
  
  <pre><code>&lt;form id="battleForm" class="battleForm" action="" method="post" role="form"&gt;
      &lt;input type="hidden" name="userID" value="{{Auth::id()}}"&gt;
  
      &lt;div class="form-group"&gt;
        &lt;label for="title"&gt;Title of the battle?&lt;/label&gt;&lt;br&gt;
        &lt;input type="text" id="title" name="title" placeholder=""&gt;&lt;br&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
        &lt;label for="points"&gt;Points to be earned&lt;/label&gt;&lt;br&gt;
        &lt;input type="text" id="points" name="points" placeholder=""&gt;&lt;br&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group date"&gt;
        &lt;label for="startdate"&gt;Startdate&lt;/label&gt;&lt;br&gt;
        &lt;input type="date" id="startdate" name="startdate" placeholder=""&gt;&lt;br&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group date"&gt;
        &lt;label for="enddate"&gt;Enddate&lt;/label&gt;&lt;br&gt;
        &lt;input type="date" id="enddate" name="enddate" placeholder=""&gt;&lt;br&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
        &lt;label for="description"&gt;What is the battle about?&lt;/label&gt;&lt;br&gt;
        &lt;textarea type="text" id="description" name="description" placeholder=""&gt;&lt;/textarea&gt;&lt;br&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group radiobuttons"&gt;
        &lt;label for="group1"&gt;Want to start de battle right away?&lt;/label&gt;&lt;br&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;input class="radiobattle" type="radio" name="active" value="yes"&gt; &lt;span&gt;yes&lt;/span&gt;&lt;/li&gt;
          &lt;li&gt;&lt;input class="radiobattle" type="radio" name="active" value="no"&gt;&lt;span&gt;no&lt;/span&gt;&lt;br&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group battleimg uploadbatlle field"&gt;
        &lt;img id="previewNewFile" src="" style="height:100px; width:150px;display: none; " required="true"/&gt;
        &lt;input style="" type="file" name="file" id="file" required="true"&gt;
      &lt;/div&gt;
      &lt;br&gt;
  
      &lt;input type="submit" name="battleSubmit" class="battleSubmit" value="Add new Battle"&gt;&lt;br&gt;
      &lt;input type="hidden" class="tokenReferEmail" name="_token" value="&lt;?php echo csrf_token(); ?&gt;"&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>I really hope you guys can help me.</p>