$.ajax({
url: "/admin/getPost",
cache: false,
data: $('#form').serialize(),
type: "POST",
complete: function() {
$('#loader').remove();
$('#form').remove();
$('#error').show();
},
beforeSend: function(request) {
return request.setRequestHeader('X-CSRF-Token', $("meta[name='csrf-token']").attr('content'));
},
success: function(response) {
$('.row').append(response);
}
});