Hello i am having a 419 Error that keeps on showing even when i try switching techniques between blade syntax url, normal javasript url ,jason data format or sending my data with the url .Please Help i also included X-CSRF in the head:
<meta name="csrf-token" content="{{ csrf_token() }}">
My call:
$.ajaxSetup({
headers: { 'X-CSRF-Token' : $('meta[name=_token]').attr('content') }
});
$.ajax({
url:'{{url("/HeatMapCoordinates")}}',
data:{"finalPointArray" :finalPointsMap,
"tourId":tourId
},
dataType: 'html',
async:true,
type:'post',
processData: false,
contentType: false,
success:function(response){
console.log('response');
},
error:function(e){
console.log('error');
}
});
}
my route: Route::resource('/HeatMapCoordinates','HeatMapCoordinatesController'); My Controller:
public function store(Request $request)
{
$this->validate($request, array(
'finalPointArray' => 'required',
'tourId' => 'required',
));
..... }