$.ajax({
headers: {
'X-CSRF-TOKEN': "{{csrf_token()}}",
},
url : "{{route('')}}",
type : "GET",
success : function(response){
}
});
<head>
<meta name="csrf-token" content="{{ csrf_token() }}" />
</head>
<!-- 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>
<meta name="csrf-token" content="{{ csrf_token() }}" />
<script type="text/javascript">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
</script>
{{ csrf_token() }}
{{ csrf_field() }}
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
data: {
'_token' : '{{csrf_token()}}',
'contactNo': '016********',
},
"_token": "{{ csrf_token() }}",
<form method="POST" action="/profile">
@csrf
<input name="name">
<button type="submit">send</button>
</form>
"_token": "{{ csrf_token() }}",