Sounds like you are not sending the _token to the Laravel server instance. I had the same issue when i moved from L4 to L5. In your HTML or Blade do this tom get you started.
<!doctype html>
<html>
<head>
<title>Manage Contact Types</title>
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="stylesheet" href="/assets/css/alertify.css" />
<link rel="stylesheet" href="/assets/css/themes/default.css" />
<meta name="csrf-token" content="<?php echo csrf_token() ?>"/>
</head>
<body>
....... blah blah
This puts the token in your header. Then pick it up and send it back as part of AJAX data.
PayloadMsg.prototype.call = function(url, callData, context) {
this.urlExists(url, this.exists);
if (this.urlOk == false || url == "" || arguments.length == 0) {
fyi("Bad URL [" + url + "]");
this.getToken();
return;
}
if (arguments.length == 1) {
callData = "";
this.context = null;
}
if (arguments.length == 2) {
this.context = null;
}
if (arguments.length > 2) {
this.context = arguments[2];
}
//fyi("inside call...");
// how do we check the url is correct? timeout causes problems.
// the busy flag needs to be static for the class.
// make sure if callData is an object we make it an empty object.
// we do this so we can add _token to it.
if (callData == "") {
callData = {};
}
this.busy = true;
callData['_token'] = this.csrf_token;
fyi('Post token [' + callData['_token'] + ']');
$.myPost(url, callData, this, this.handlePost, this.postError, this.timeout, this.async);
};
In the beginning I was just pulling the token out of the header in my JS AJAX class constructor...
//this.csrf_token = $('meta[name="csrf-token"]').attr('content');
Of course that token will expire