在头部使用此命令:
<meta name="csrf-token" content="{{ csrf_token() }}">并在ajax中获取csrf令牌:
$.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }});请参考Laravel文档csrf_token

在头部使用此命令:
<meta name="csrf-token" content="{{ csrf_token() }}">并在ajax中获取csrf令牌:
$.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }});请参考Laravel文档csrf_token