laravel form ajax with jquery
//at view blade, must put data-remote
{!! Form::open(array('data-remote','url' => 'notices/'.$notice->id, 'method' => 'PATCH')) !!}
//js
$(function() {
var submitAjaxRequest = function(e){
var form = $(this);
var method = form.find('inputp[name="_method"]').val() || 'POST';
$.ajax({
url: form.prop('action'),
type: method,
data: form.serialize(),
success: function()
{
alert('success');
}
});
e.preventDefault();
};
$('form[data-remote]').on('submit', submitAjaxRequest);
});