function add(obj) {
var id = obj.id;
$.ajax({
url: document.location.origin+ "/main/add_to_card",
type: "POST",
data: {"id": id},
cache: false,
success: function (response) {
window.location.reload();
}
});
}
А в контроллере
$id = request()->input('id')