I'm saving data with the help of ajax and laravel. In the form the text field data is saving but the file is not saving with the help of ajax.
This is my script.
<script>
$(document).ready(function() {
$('#ajax').submit(function(event){
event.preventDefault();
$.ajax({
type: 'POST',
url: 'post_contact',
data: $('form#ajax').serialize(),
dataType: 'json',
})
.done(function(data) {
console.log(data);
});
return false;
});
});
</script>