title: Laravel: File upload not working
body: <p>I'm trying to upload an image via an HTML form in Laravel 5.5. I have included the <code>enctype="multipart/form-data"</code> attribute, still nothing happens.</p>
  
  <p>Form code:</p>
  
  <pre><code>&lt;form method="POST" enctype="multipart/form-data"&gt;
    {{ csrf_field() }}
    &lt;div class="form-group"&gt;
      &lt;label for="m_photo" class="col-md-4 control-label"&gt;Main photo&lt;/label&gt;
      &lt;div class="col-md-6"&gt;
        &lt;input id="m_photo" type="file" class="form-control-file space" name="m_photo" required&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;div class="col-md-6 col-md-offset-4"&gt;
        &lt;button type="submit" class="btn btn-primary"&gt;Submit&lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Route (web.php) code:</p>
  
  <pre><code>Route::post('smartphones/entry', 'HomeController@s_submit')-&gt;name('s_submit');
  </code></pre>
  
  <p>Controller code:</p>
  
  <pre><code>public function s_submit() {
    if (Input::hasFile('m_photo')) {
        // doing something
    }
  
    else {
        echo 'Nothing happened';
    }
  }
  </code></pre>
  
  <p>'Nothing happened' is echoed out when I submit the form.</p>
  
  <p>It's interesting that when I do this:</p>
  
  <pre><code>public function s_submit(Request $request) {
      $input = Input::all();
      dd($input);
  }
  </code></pre>
  
  <p>I see:</p>
  
  <pre><code>array:1 [
  "m_photo" =&gt; UploadedFile {#210 ▶}
  ]
  </code></pre>
  
  <p>It's like the image <em>is</em> getting passed, but I'm unable to retrieve it. Please help.</p>