FilePond can upload files using POST request type so that's fine in Laravel. However, FilePond sends DELETE request when reverting/removing the uploaded file/s. Laravel doesn't support DELETE request directly but rather used a _method field with DELETE value sent as a POST request.
So now I'm making a POST request for a deleting but can't seem to figure out how to add data to my revert request in FilePond. My options looks like so:
FilePond.setOptions({
server: {
...
revert: {
url: '/filepond',
method: 'POST',
headers: {
'X-CSRF-TOKEN': csrf_token
}
}
...
}
});
Data required by Laravel (data to be added in the POST request not in the header but in the form data).
'_method': 'DELETE'