title: PATCH AJAX Request in Laravel
body: <p>Is it possible to make AJAX PATCH requests to laravel,  or am I restricted to POST? Laravel uses PATCH in input hidden fields, however, I am not using form elements&mdash;just buttons that should partially update a record when clicked (via an AJAX request).</p>
  
  <p>How would the route look like for this?</p>
  
  <p><strong>Routes file</strong></p>
  
  <p><code>Route::patch('questions/{id}', 'QuestionController@update')-&gt;before('admin');</code></p>
  
  <p><em>I am not sure if laravel routes support PATCH.</em></p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public function update($id) {
      if (Request::ajax() &amp;&amp; Request::isMethod('patch')) {
          //partially update record here
      }
  }
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>$('div#question_preview &lt;some button selector&gt;').click(function (event) {
      $.ajax({
          url: 'questions/'+question_id,
          type: 'PATCH',
          data: {status: 'some status'}
      });
  });
  </code></pre>
  
  <p>I am just looking for clarity, thanks!</p>