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

Fixed Synced resources between tenants throws error when inserting new model on tenant

This commit is contained in:
abdulmajid 2022-05-27 17:23:56 +01:00
parent 51228defc6
commit eaff0ad17e

View file

@ -60,7 +60,7 @@ 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());
$centralModel = $event->model->getCentralModelName()::create(collect($event->model->getAttributes())->except(['id'])->toArray());
event(new SyncedResourceChangedInForeignDatabase($event->model, null));
}
});