I'm new to Laravel and have gone through several solutions on tackoverflow, but to no avail. It's still showing the same error of Cross-Origin Request Blocked.
$(".cmd_submit").click(function(){
$.ajax({
//crossOrigin: true,
//header:{'Access-Control-Allow-Origin': '*'},
type: 'POST',
url: 'http://localhost/members/register',
data: $('#form_reg').serialize(),
success: function(data){
alert(data);
},
error: function(data){
alert(data);
}
I also included this:
<?php header("Access-Control-Allow-Origin: *"); ?>
on my app.blade.php, but it still didn't work.