
在form表单里提交表单时,可
<form action="" method="post">
<?php echo csrf_field(); ?>
<input type="sbumit" name="提交"/>
</form>
使用ajax请求时
<meta name="csrf-token" content="{{ csrf_token() }}">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});