Laravel 5.3's $api->resource()
routes map PUT requests to the controller's update
method.
I fail to trigger a validation error when an empty HTTP PUT request is made. My $this->validate()
rules are all optional, since no field is required in an update.
But I'd really like to let validation fail if the request is empty (count($request->all() == 0
).
Is there a way to do that with the in-built validation rules?
A validation rule of '*' => 'min:1'
does not work.