diff --git a/src/Listeners/UpdateSyncedResource.php b/src/Listeners/UpdateSyncedResource.php index 40d4d644..53c497a4 100644 --- a/src/Listeners/UpdateSyncedResource.php +++ b/src/Listeners/UpdateSyncedResource.php @@ -60,7 +60,10 @@ class UpdateSyncedResource extends QueueableListener } else { // If the resource doesn't exist at all in the central DB,we create // the record with all attributes, not just the synced ones. - $centralModel = $event->model->getCentralModelName()::create($event->model->getAttributes()); + $attributes = $event->model->getAttributes(); + unset($attributes['id']); + + $centralModel = $event->model->getCentralModelName()::create($attributes); event(new SyncedResourceChangedInForeignDatabase($event->model, null)); } });