title: Call to a member function getClientOriginalExtension() on string in Laravel
body: <p>I am trying to upload a form with image using AJAX in my Laravel project. But I have getting error </p>
  
  <blockquote>
    <p>Call to a member function getClientOriginalExtension() on string</p>
  </blockquote>
  
  <p>I can't find the solution.</p>
  
  <p><strong>html form</strong></p>
  
  <pre><code>&lt;form id="edit_form" enctype="multipart/form-data"&gt;
  &lt;input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" /&gt;
  
  &lt;div class="form-group"&gt;
      &lt;label&gt;Image&lt;/label&gt;
      &lt;input id="edit_form_image" type="file" class="form-control" name="user_image"&gt;
  &lt;/div&gt;&lt;!-- end form-group --&gt;
  
  &lt;div class="form-group"&gt;
      &lt;label&gt;Name&lt;/label&gt;
      &lt;input id="edit_form_name" type="text" class="form-control" value="{{Auth::user()-&gt;name}}"&gt;
  &lt;/div&gt;&lt;!-- end form-group --&gt;
  
  &lt;div class="form-group"&gt;
      &lt;label&gt;Profession&lt;/label&gt;
      &lt;input id="edit_form_profession" type="text" class="form-control"  value="{{Auth::user()-&gt;profession}}"&gt;
  &lt;/div&gt;&lt;!-- end form-group --&gt;
  
  &lt;button type="button" id="edit_form_submit" class="btn btn-orange"&gt;Save Changes&lt;/button&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>ajax part</strong></p>
  
  <pre><code>$('#signin_button').click(function(event) {
  
  var edit_form_image = $('#edit_form_image').val();
  var edit_form_name = $('#edit_form_name').val();
  var edit_form_profession = $('#edit_form_profession').val();
  
  $.ajax({
  
             url:"{{ url('/profile-update') }}",
             data: {image: edit_form_image, name: edit_form_name, profession: edit_foredit_form_professionm_email,  _token: token},
             dataType:'json',
             async:false,
             type: 'POST',
             processData: false,
             contentType: false,
             success:function(msg)
             {
                 console.log(msg);
             }                      
         });
  </code></pre>
  
  <p>});</p>
  
  <p><strong>controller</strong></p>
  
  <pre><code>public function profile_update()
  {
  $this-&gt;validate(request(), [
      'name' =&gt; 'required',
      'profession' =&gt; 'required'
  ]);
  
  $imageName = time().'.'.request('image')-&gt;getClientOriginalExtension();
  
  request()-&gt;image-&gt;move(public_path('images'), $imageName);
  
  $user = Auth::user();
  
  $user-&gt;name = request('name');
  $user-&gt;profession = request('profession');
  $user-&gt;avatar = $imageName;
  
  $user-&gt;save();
  
  return '1';
  </code></pre>
  
  <p>}</p>
  
  <p>Where is the problem and how to solve that ? </p>
  
  <p>Anybody help please ?</p>