How to pass CSRF token with ajax request?
In between head, tag put <meta name="csrf-token" content="{{ csrf_token() }}"> and in Ajax, we have to add
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
BY Best Interview Question ON 12 May 2020