Skip to content

Commit

Permalink
Merge pull request #74 from odparraj/main
Browse files Browse the repository at this point in the history
fix: batch update using model key name, instead of controller's key name
  • Loading branch information
alexzarbn authored Apr 11, 2021
2 parents 0fd5f65 + 6f81391 commit df51990
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Concerns/HandlesStandardBatchOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function batchUpdate(Request $request)
$this->beforeSave($request, $entity);

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

$entity = $entity->fresh($requestedRelations);
Expand Down Expand Up @@ -399,4 +399,4 @@ protected function afterBatchRestore(Request $request, Collection $entities)
{
return null;
}
}
}

0 comments on commit df51990

Please sign in to comment.