title: how to pass named route parameter with ajax
body: <p>I need to pass route parameter with <code>ajax</code> but I am using named route method in <code>ajax</code> code.</p>
  
  <p>route I want to go 
  <strong>Route</strong></p>
  
  <pre><code>Route::post('/edit/{id}', 'ArticleController@updateArticle')-&gt;name('updateArticle');
  </code></pre>
  
  <p><strong>Ajax</strong></p>
  
  <pre><code>var id= $("input[name=editId]").val();
  $.ajax({
     type:'POST',
     enctype: 'multipart/form-data',
     url:"{{ route('updateArticle',"id") }}",
     data: formdata,
     contentType: false,
     processData: false,
     success:function(data){
          $('.alert-success').html(data.success).fadeIn('slow');
          $('.alert-success').delay(3000).fadeOut('slow');
     }
  });
  </code></pre>
  
  <p>I want to use variable <code>id</code> in <code>ajax</code> URL.</p>