You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to modify an entity by using the PATCH method. The entity has 3 fields: 'firstname', 'lastname' and 'address', so I am sending only one of those parameters to the update method of the repository. However it is validating all of them.
public function update(Request $request, $id)
{
$this->repository->update($request->all(), $id);
return $this->response->created();
}
The $request->all is a single field. Additionally this is my repository:
use Prettus\Repository\Eloquent\BaseRepository;
class UserRepositoryEloquent extends BaseRepository
{
# do nothing because it extends the update of the BaseRpository
}
However by sending a single field to update, the others fields are being validated and as a consequence I receive an validation error. The only field that should be validated is the one send in the attributes array. I would like to know how could I use the PATCH then?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to modify an entity by using the PATCH method. The entity has 3 fields: 'firstname', 'lastname' and 'address', so I am sending only one of those parameters to the update method of the repository. However it is validating all of them.
This is my validator
This is my controller:
The $request->all is a single field. Additionally this is my repository:
However by sending a single field to update, the others fields are being validated and as a consequence I receive an validation error. The only field that should be validated is the one send in the attributes array. I would like to know how could I use the PATCH then?
Thanks!
The text was updated successfully, but these errors were encountered: