Skip to content

Commit

Permalink
fix: relations batch update using model key name, instead of controll…
Browse files Browse the repository at this point in the history
…er's key name
  • Loading branch information
alexzarbn committed Apr 11, 2021
1 parent df51990 commit c03e9d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Concerns/HandlesRelationStandardBatchOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function batchUpdate(Request $request, $parentKey)
/** @var Model $entity */
$this->authorize('update', $entity);

$resource = $request->input("resources.{$entity->getKey()}");
$resource = $request->input("resources.{$entity->{$this->keyName()}}");

$this->beforeUpdate($request, $entity);
$this->beforeSave($request, $entity);
Expand Down Expand Up @@ -547,4 +547,4 @@ protected function afterBatchRestore(Request $request, Collection $entities)
{
return null;
}
}
}

0 comments on commit c03e9d6

Please sign in to comment.