Skip to content

Commit

Permalink
Patch fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryk committed Aug 9, 2021
1 parent 8bd9221 commit 2f061b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Repositories/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,12 @@ public function update(RestifyRequest $request, $repositoryId)
public function patch(RestifyRequest $request, $repositoryId)
{
DB::transaction(function () use ($request) {
$keys = $request->json()->keys();

$fields = $this->collectFields($request)
->intersectByKeys($request->json()->keys())
->filter(
fn (Field $field) => in_array($field->attribute, $keys),
)
->forUpdate($request, $this)
->authorizedPatch($request)
->merge($this->collectFields($request)->forBelongsTo($request));
Expand Down

0 comments on commit 2f061b0

Please sign in to comment.