From 88438d178687aa14531bff58d5ee51d4f85af683 Mon Sep 17 00:00:00 2001 From: Abrar Ahmad Date: Mon, 3 Oct 2022 14:18:20 +0500 Subject: [PATCH] Update UpdateSyncedResource.php --- src/Listeners/UpdateSyncedResource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Listeners/UpdateSyncedResource.php b/src/Listeners/UpdateSyncedResource.php index 245661c3..0b2d1517 100644 --- a/src/Listeners/UpdateSyncedResource.php +++ b/src/Listeners/UpdateSyncedResource.php @@ -139,9 +139,9 @@ class UpdateSyncedResource extends QueueableListener { if (! $model->getSyncedCreationAttributes()) { // Creation attributes are not specified so create the model as 1:1 copy - // exclude the "id" parameter because we want to keep the id to handle by the target model to avoid duplication error + // exclude the "primary key" because we want primary key to handle by the target model to avoid duplication errors $attributes = $model->getAttributes(); - unset($attributes['id']); + unset($attributes[$model->getKeyName()]); return $attributes; }