title: Laravel 5.1: can't upload a video file
body: <p>On submitting a file I had this following error:</p>
  
  <pre><code>SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'video_ogg' cannot be null (SQL: insert into `profiles` (`about_me`, `video_ogg`, `updated_at`, `created_at`) values (lorem, , 2017-07-23 02:15:50, 2017-07-23 02:15:50))
  </code></pre>
  
  <p>which states that the field <code>video_ogg cannot be null</code> but when I verify on debugging mode this field is not empty (see below)</p>
  
  <p>controller</p>
  
  <pre><code>    public function store(Request $request)
     {
        // Validation //
        $validation = Validator::make($request-&gt;all(), [
           'about_me' =&gt; 'required',
           'video_ogg'    =&gt; 'required|mimes:mp4,ogx,oga,ogv,ogg,webm|min:1|max:3240',
        ]);
  
        // Check if it fails //
        if( $validation-&gt;fails() ){
           return redirect()-&gt;back()-&gt;withInput()
                            -&gt;with('errors', $validation-&gt;errors() );
        }
  
        $profile = new Profile;
  
        //Debugging
        dd($request-&gt;files);
  
        // save media data into database //
        $profile-&gt;about_me = $request-&gt;input('about_me');
        $profile-&gt;video_ogg = $request-&gt;input('video_ogg');
        $profile-&gt;save();
  
        return redirect('/profile')-&gt;with('message','You just created your profile!');
     }
  </code></pre>
  
  <p>debugging result</p>
  
  <pre><code>FileBag {#45 ▼
    #parameters: array:1 [▼
      "video_ogg" =&gt; UploadedFile {#30 ▼
        -test: false
        -originalName: "mov_bbb.ogg"
        -mimeType: "audio/ogg"
        -size: 614492
        -error: 0
      }
    ]
  }
  </code></pre>
  
  <p>Here as you can see on debugging the video is uploaded or I mean is in the request array but I still have an error message.</p>
  
  <pre><code>SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'video_ogg' cannot be null (SQL: insert into `profiles` (`about_me`, `video_ogg`, `updated_at`, `created_at`) values (lorem, , 2017-07-23 02:15:50, 2017-07-23 02:15:50))
  </code></pre>
  
  <p>view</p>
  
  <pre><code>{!! Form::open(['url'=&gt;'/profile', 'method'=&gt;'POST', 'files'=&gt;'true']) !!}
  ...
        &lt;div class="form-group"&gt;
           &lt;label for="video_ogg"&gt;Upload Video (ogg)&lt;/label&gt;
           &lt;input type="file" class="form-control" name="video_ogg"&gt;
        &lt;/div&gt;
  ...
  </code></pre>
  
  <p>which output this</p>
  
  <pre><code>&lt;form method="POST" action="http://localhost:8000/profile" accept-charset="UTF-8" enctype="multipart/form-data"&gt;&lt;input name="_token" type="hidden" value="KxvK6tONoUhBCx58ESlbE1hh9eP8hy5nQyNqb62W"&gt;
  </code></pre>
  
  <p>So I did verify that <code>enctype="multipart/form-data"</code> is in the form.</p>
  
  <p>model</p>
  
  <pre><code>class Profile extends Model
  {
      //
      protected $fillable = ['video_ogg', 'about_me'];
  }
  </code></pre>