title: Laravel 5.1 AJAX - Returning 405 GET Method Not Allowed even when I am sending a POST request
body: <p>My Laravel POST route returns 405 GET Method not allowed when I am sending a POST request through AJAX. However the problem is that it works in <code>localhost</code> but not working in Heroku <code>production server</code>. My AJAX POST request gets sent as GET request to the route. Below i have attached a screenshot and my AJAX code.</p>
  
  <pre><code>$.ajax({
              url: url,
              type: 'POST',
              data: data,
              contentType: 'application/json',
              headers: {
                  'X-CSRF-TOKEN': token
              }
          })
  </code></pre>
  
  <p>My route is configured as:</p>
  
  <pre><code>Route::post('/adminpanel/projects/delete/', 'AdminPanelController@deleteData');
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7f8tS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7f8tS.png" alt="enter image description here"></a></p>