From 6f813912d94afde59c732d9761df60803934808e Mon Sep 17 00:00:00 2001 From: Oscar Parra Date: Fri, 9 Apr 2021 05:39:29 -0500 Subject: [PATCH] Update HandlesStandardBatchOperations.php Fix in batch update, It must correspond to key configured in the controller to have possibility of mass updating with a different key than ID or model primary key --- src/Concerns/HandlesStandardBatchOperations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Concerns/HandlesStandardBatchOperations.php b/src/Concerns/HandlesStandardBatchOperations.php index 2eb63b35..9dd40f5f 100644 --- a/src/Concerns/HandlesStandardBatchOperations.php +++ b/src/Concerns/HandlesStandardBatchOperations.php @@ -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); @@ -399,4 +399,4 @@ protected function afterBatchRestore(Request $request, Collection $entities) { return null; } -} \ No newline at end of file +}