I can't figure out why this block of code only works on my localhost, in my production server the requests goes through and $request->input() returns an empty array but in my localhost it works perfectly fine. Both on version php7. Any thoughts ?
var formData = new FormData($('#postSliderFrm')[0]);
if(imagePicked)
formData.append('file',imagePicked);
formData.append('_method', 'put');
$.ajax({
type: 'PUT',
url: '{{route('dashboard.admin.sliders.update', $slider->id)}}',
data: formData,
processData: false,
contentType: false,
success: function(data) {
},
error: function(data) {
}
});
I've also tried adding
{!! method_field('put') !!}
inside my form but still no luck