I am trying to send some values to a controller using an ajax request. Below the code I am using. After clicking on the related button I get following error:
500 (Internal Server Error)
What I am doing wrong?
//ROUTE
Route::post('/checkEmail', 'MemberController@checkEmail')->name('check-email');
//TAG
<meta name="csrf_token" content="" />
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')
}
});
jQuery.ajax({
url: "",
method: 'post',
data: {
username: jQuery('#username').val(),
email: jQuery('#email').val()
},
dataType: "json",
success: function(result) {
//SOME CODE
}
});
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire