title: Passing data from Laravel 7 view to controller via Ajax
body: <p>I need to pass only one value from view to controller,using Ajax(in View home.blade.php).
  All solutions are for Laravel 5's and it's not helpful.</p>
  
  <p>Ajax from home.blade.php:</p>
  
  <pre><code>$datee="hello";
  
  $.ajaxSetup({
      headers: {
          'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
      }
  });
  
   $.ajax({
      type        : 'POST',
      url         : "insert2",
      contentType: "text",
      data:      datee ,
      dataType: 'json'
    });
  </code></pre>
  
  <p>Route:</p>
  
  <pre><code>Route::post('/insert2/{datee}', 'EditContdroller@show1');
  Route::get('/home', 'HomeController@index')-&gt;name('home');
  </code></pre>
  
  <p>And EditController's method:</p>
  
  <pre><code>  public function show1(Request $request){
  
                           $data= $request-&gt;datee;
  //some work with $data...
                           return $json_Value;
  
      }
  </code></pre>
  
  <p>I get Error 404 Post .../insert2 not found.Have you any idea,please?</p>