title: Error: Request failed with status code 405
body: <p>I am trying to establish axios sample in laravel react.js combination.I configured my project by following commands 
  composer create-project --prefer-dist laravel/laravel react-laravel-basic-8.
  php artisan preset react
  npm install
  npm audit fix --force
  npm install axios
  npm run dev
  php artisan serve.
  My web.php file is </p>
  
  <pre><code>Route::get('/', function () {
      return view('welcome');
  });
  Route::get('add-a-student',function()
  {
      return view('add_student');
  });
  Route::get('/testing/','Admin@testing');
  </code></pre>
  
  <p>My controller Admin.php is</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  
  class Admin extends Controller
  {
  
      public function testing()
      {
          echo "hello alert";
      }
  }
  </code></pre>
  
  <p>And my view add_student.blade.php is</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="{{ app()-&gt;getLocale() }}"&gt;
  &lt;head&gt;
      &lt;title&gt;React axios&lt;/title&gt;
      &lt;link rel="stylesheet" href="{{ asset('css/app.css') }}"&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="basic"&gt;&lt;/div&gt;
          &lt;script src="{{ asset('js/app.js') }}"&gt;
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And my jsx file resides in resources/assets/js/components/Example.jsx i.e</p>
  
  <pre><code>import React, { Component } from 'react';
  import ReactDOM from 'react-dom';
  import axios from 'axios';
  
  export default class Example extends Component {
      render() {
          return (
              &lt;div className="container"&gt;
                  &lt;div className="row"&gt;
                      &lt;div className="col-md-8 col-md-offset-2"&gt;
                          &lt;div className="panel panel-default"&gt;
                              &lt;div className="panel-heading"&gt;Example Component&lt;/div&gt;
  
                              &lt;div className="panel-body"&gt;
                                  I'm an example component!
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          );
      }
  }
  class Developer extends React.Component{
      handlesubmit(e)
      {
          e.preventDefault();
          axios.post('/testing/', {
      firstName: 'Fred',
      lastName: 'Flintstone'
    })
    .then(function (response) {
      alert('success');
    })
    .catch(function (error) {
      alert(error);
    });
  
      }
      render()
      {
          return(&lt;div&gt;&lt;form onSubmit={this.handlesubmit}&gt;
              &lt;table&gt;
              &lt;tr&gt;
              &lt;td&gt;
              &lt;label&gt;Date of birth&lt;/label&gt;
              &lt;/td&gt;
              &lt;td&gt;
              &lt;input type="date" name="dob"  /&gt;
              &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;button type="submit"&gt;Add student&lt;/button&gt;&lt;/td&gt;
  
               &lt;td&gt;&lt;button type="reset"&gt;Cancel&lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;/table&gt;
              &lt;/form&gt;&lt;/div&gt;);
      }
  }
  
  if (document.getElementById('example')) {
      ReactDOM.render(&lt;Example /&gt;, document.getElementById('example'));
  }
  if(document.getElementById('basic'))
  {
      ReactDOM.render(&lt;Developer /&gt;,document.getElementById('basic'));
  }
  </code></pre>
  
  <p>I got following error Error: Request failed with status code 405 while trying to submit form via axios method.Plaese help me to fix the bug</p>