This is a known issue and the workaround suggestion as per the following Github comment is that when sending a PATCH
/ PUT
requests you should do the following:
You should send POST and set _method to PUT (same as sending forms) to make your files visible
So essentially you send a POST request with a parameter which sets the actual method and Laravel seems to understand that.
As per the documentation:
Since HTML forms can’t make
PUT
,PATCH
, orDELETE
requests, you will need to add a hidden_method
field to spoof these HTTP verbs. The@method
Blade directive can create this field for you:
<form action="/foo/bar" method="POST">
@method('PUT')
...
</form>
Alternatively, you can use the method_field
helper function to do the above:
The method_field function generates an HTML hidden input field containing the spoofed value of the form’s HTTP verb. For example, using Blade syntax:
<form method="POST">
{{ method_field('PUT') }}
</form>