Cannot read multipart/form-data from request in Laravel
<p>I am trying to send form with upload file and multipart/form-data encoding using AJAX. I am using this form:</p>

<pre><code>{!! Form::model($user, ['method' =&gt; 'PATCH', 'url' =&gt; ['/administrator/users', $user-&gt;id], 'class' =&gt; 'form-horizontal', 'files' =&gt; 'true', 'id' =&gt; 'userEdit']) !!}
    &lt;div class="modal-body"&gt;
        &lt;div class="form-group"&gt;
            &lt;label class="col-sm-3 control-label"&gt;Avatar:&lt;/label&gt;
            &lt;div class="col-sm-9"&gt;
                &lt;img src="/dashboard/assets/img/avatar/{{ $user-&gt;profile-&gt;avatar }}" class="img-circle m-b" /&gt;
                &lt;input type="file" name="avatar" /&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;hr /&gt;
        &lt;div class="form-group"&gt;
            &lt;label class="col-sm-3 control-label"&gt;Name:&lt;/label&gt;
            &lt;div class="col-sm-9"&gt;
                &lt;input type="text" name="first_name" value="{{ $user-&gt;profile-&gt;first_name }}" class="form-control" /&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
            &lt;label class="col-sm-3 control-label"&gt;Surname:&lt;/label&gt;
            &lt;div class="col-sm-9"&gt;
                &lt;input type="text" name="last_name" value="{{ $user-&gt;profile-&gt;last_name }}" class="form-control" /&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="modal-footer"&gt;
        &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
        &lt;button type="submit" class="btn btn-info" data-user-id="{{$user-&gt;id}}"&gt;Save&lt;/button&gt;
    &lt;/div&gt;
{!! Form::close() !!}
</code></pre>

<p>I try to send data with Ajax like this:</p>

<pre><code>$('#editUser').submit('#userEdit', function(event) {
            event.preventDefault();
            $.ajax({
                type: 'PATCH',
                url: '/administrator/users/1',
                data: new FormData(userEdit),
                processData: false,
                contentType: false,
                mimeType: "multipart/form-data",
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                success: function(data) {
                    alert(data);
                },
                error:  function(xhr, str){
                    alert(str);
                }
            });
        });
</code></pre>

<p>And in result, I cannot read inputs from request in controller. It returns an empty array.</p>

<pre><code>    public function update($id, Request $request){
        dd($request-&gt;all());
    }
</code></pre>

<p>I think that I'm doing something wrong with sending multipart data. How to send it correctly?</p>