Published
- 1 min read
laravel jquery csrf
The solution for this is noted below
laravel jquery csrf
Solution
In header
<meta name="csrf-token" content="{{ csrf_token() }}" />
In script
<script type="text/javascript">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
</script>
Try other methods by searching on the site. That is if this doesn’t work