1//It's an error of csrf token, there is multiples ways to fix it, too much to
2//write a grepper answer on.
3
4//419 : error of csrf token
5
6//Common way to fix it, try this
7$.ajaxSetup({
8 headers: {
9 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
10 }
11});
1Use this in the head section:
2
3<meta name="csrf-token" content="{{ csrf_token() }}">
4
5and get the csrf token in ajax:
6$.ajaxSetup({
7 headers: {
8 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
9 }
10});