1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 22:24:03 +00:00

Update UpdateSyncedResource.php

This commit is contained in:
Abrar Ahmad 2022-10-03 14:18:20 +05:00
parent 0170ccc391
commit 88438d1786

View file

@ -139,9 +139,9 @@ class UpdateSyncedResource extends QueueableListener
{ {
if (! $model->getSyncedCreationAttributes()) { if (! $model->getSyncedCreationAttributes()) {
// Creation attributes are not specified so create the model as 1:1 copy // 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(); $attributes = $model->getAttributes();
unset($attributes['id']); unset($attributes[$model->getKeyName()]);
return $attributes; return $attributes;
} }