title: Laravel ajax POST 404 (Not Found)
body: <p>I'm creating searching function for my table in my laravel project. I'm using ajax live search method but facing some error now when insert into the search bar. The errors shown in console are POST 404 (not found). 
  My post is below. I'm not sure why this has stopped working.</p>
  
  <p>Sorry for my bad English.</p>
  
  <p><strong>This is my script</strong></p>
  
  <pre><code>$(document).ready(function(){
  
    load_data();
  
    function load_data (query)
    {
      $.ajax({
        url:"fetch.php",
        method:"POST",
        data:{query:query},
         success:function(data)
        {
          $('#table').html(data);
        }
      });
    }
  
    $('#search').keyup(function(){
    var search = $(this).val();
    if(search != '')
    {
     load_data(search);
    }
    else
    {
     load_data();
    }
   });
  </code></pre>
  
  <p><strong>fetch.php</strong></p>
  
  <pre><code>&lt;?php
  if(isset($_POST["query"]))
  { 
  $connect = mysqli_connect("localhost", "root", "", "testing");
  $request = mysqli_real_escape_string($connect, $_POST["query"]);
  $query = "
    SELECT * FROM domain
    WHERE Domain LIKE '%".$request."%'
  ";
  $result = mysqli_query($connect, $query);
  $html = '';
  $data = array();
  $html .= '
        &lt;table class="table table-bordered table-striped"&gt;
          &lt;tr&gt;
            &lt;th&gt;Domain&lt;/th&gt;
            &lt;th&gt;Registrar&lt;/th&gt;
            &lt;th&gt;Login ID&lt;/th&gt; 
            &lt;th&gt;Password&lt;/th&gt;
          &lt;/tr&gt;
      ';
      while ($row = mysqli_fetch_array($result)) 
      {
        $data[] = $row["Domain"];
        $data[] = $row["Registrar"];
        $data[] = $row["Login_ID"];
        $data[] = $row["Password"];
        $html .= '
          &lt;tr&gt;
            &lt;td&gt;'.$row["Domain"].'&lt;/td&gt;
            &lt;td&gt;'.$row["Registrar"].'&lt;/td&gt;
            &lt;td&gt;'.$row["Login_ID"].'&lt;/td&gt;
            &lt;td&gt;'.$row["Password"].'&lt;/td&gt;
           &lt;/tr&gt;
        ';
      }
      $html .= '&lt;/table&gt;';
  
      if (isset($_POST["typehead_search"])) 
      {
        echo $html;
      }
      else 
      {
        $data = array_unique($data);
        echo json_encode($data);
      }    
  }
  ?&gt;
  </code></pre>