title: Error 405 (Method Not Allowed) Laravel 5
body: <p>Im trying to do a POST request with jQuery but im getting a error 405 (Method Not Allowed), Im working with Laravel 5</p>
  
  <p>THis is my code:</p>
  
  <p>jQuery</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $('.delete').click(function (e){
              e.preventDefault();
              var row = $(this).parents('tr');
              var id = row.data('id');
              var form = $('#formDelete');
              var url = form.attr('action').replace(':USER_ID', id);
              var data = form.serialize();
              $.post(url, data, function (result){
                  alert(result);
              });
          });
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>{!! Form::open(['route' =&gt; ['companiesDelete', ':USER_ID'], 'method' =&gt;'DELETE', 'id' =&gt; 'formDelete']) !!}
  
      {!!Form::close() !!}
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>public function delete($id, \Request $request){
          return $id;
      }
  </code></pre>
  
  <p>The Jquery error is <a href="http://localhost/laravel5.1/public/empresas/eliminar/5">http://localhost/laravel5.1/public/empresas/eliminar/5</a> 405 (Method Not Allowed).</p>
  
  <p>The url value is </p>
  
  <pre><code>http://localhost/laravel5.1/public/empresas/eliminar/5
  </code></pre>
  
  <p>and the data value is </p>
  
  <pre><code>_method=DELETE&amp;_token=pCETpf1jDT1rY615o62W0UK7hs3UnTNm1t0vmIRZ.
  </code></pre>
  
  <p>If i change to <code>$.get</code> request it works fine, but i want to do a post request.</p>
  
  <p>Anyone could help me?</p>
  
  <p>Thanks.</p>
  
  <p>EDIT!!</p>
  
  <p>Route</p>
  
  <pre><code>Route::post('empresas/eliminar/{id}', ['as' =&gt; 'companiesDelete', 'uses' =&gt; 'CompaniesController@delete']);
  </code></pre>