出于安全原因,Laravel 5使用csrf令牌验证....尝试此操作…
在routes.php中
route post('form-data', 'FormController@postform');在主布局文件中
<meta name="csrf-token" content="{{ csrf_token() }}" />var CSRF_TOKEN = $(’meta [name =“ csrf-token”]’)。attr(’content’);
$.ajax({url: '/form-data/',type: 'POST',data: {_token: CSRF_TOKEN},dataType: 'JSON',success: function (data) { console.log(data);}});



