title: Laravel Request Method: PUT - Status Code: 500 Internal Server Error
body: <p>I have this error with the request ajax for the method <code>PUT</code>:</p>
  
  <blockquote>
    <p>Status Code: 500 Internal Server Error</p>
  </blockquote>
  
  <p>where is my error, please</p>
  
  <p>PHP, controller PocController</p>
  
  <pre><code>    public function update(Request $request, Post $post)
  {
      $post_edit = Post::find($post-&gt;id);
  
      $update = $post_edit-&gt;save($request-&gt;all());
  
      return $update;
  }
  </code></pre>
  
  <p>Javascript in page:</p>
  
  <pre><code>            $('.btn-save').click(function(e){
              e.preventDefault();
              var title = $('#titolo').val();
              var body = $('#contenuto').val();
              var id = $('#record_id').val();
              var token = $('input[name=_token]').val();
  
              $.ajax({
                  type: 'PUT',
                  url: '/posts/'+id,
                  data: {
                      'id': id,
                      '_token': token,
                      'title': title,
                      'body': body,
                      '_method': 'PUT'
                  },
                  success:function(response) {
                      console.log(response);
                  }
              });
          });
  </code></pre>
  
  <p>And this is my form in Laravel 5.6:</p>
  
  <p><a href="https://i.stack.imgur.com/Ycz3c.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>In network console i have this response:</p>
  
  <p>general :
  Request URL: <a href="http://ajax.local/posts/1" rel="nofollow noreferrer">http://ajax.local/posts/1</a>
  Request Method: PUT
  Status Code: 500 Internal Server Error
  Remote Address: 192.168.10.10:80
  Referrer Policy: no-referrer-when-downgrade</p>
  
  <p>Response header:
  Cache-Control: no-cache, private
  Connection: keep-alive
  Content-Type: application/json
  Date: Sun, 22 Apr 2018 12:08:07 GMT</p>