how to pass laravel route name to ajax request

Solutions on MaxInterview for how to pass laravel route name to ajax request by the best coders in the world

showing results for - "how to pass laravel route name to ajax request"
Valentina
06 Oct 2016
1var id= $("input[name=editId]").val();
2$.ajax({
3   type:'POST',
4   enctype: 'multipart/form-data',
5   url:"{{ route('updateArticle') }}" + '/' + id,
6   data: formdata,
7   contentType: false,
8   processData: false,
9   success:function(data){
10        $('.alert-success').html(data.success).fadeIn('slow');
11        $('.alert-success').delay(3000).fadeOut('slow');
12   }
13});
14