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