1$.ajaxSetup({
2 headers: {
3 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
4 }
5});
1$.ajaxSetup({
2 headers: {
3 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
4 }
5});
1In header
2
3<meta name="csrf-token" content="{{ csrf_token() }}" />
4
5In script
6
7<script type="text/javascript">
8$.ajaxSetup({
9 headers: {
10 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
11 }
12});
13</script>
1<script type="text/javascript">
2$.ajaxSetup({
3 headers: {
4 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
5 }
6});
7</script>
8