$.ajax({
headers: {
'X-CSRF-TOKEN': "{{csrf_token()}}",
},
url : "{{route('')}}",
type : "GET",
success : function(response){
}
});
<!-- Add this to header -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<!-- Add this to script -->
<script>
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
</script>
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
"_token": "{{ csrf_token() }}",
"_token": "{{ csrf_token() }}",