mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 08:24:05 +00:00
create config key
This commit is contained in:
parent
7a8baad3ca
commit
c9147b5849
2 changed files with 9 additions and 1 deletions
|
|
@ -196,4 +196,9 @@ return [
|
|||
'--class' => 'DatabaseSeeder', // root seeder class
|
||||
// '--force' => true,
|
||||
],
|
||||
|
||||
/**
|
||||
* Allow the resource be created in the central DB just with the synced attributes.
|
||||
*/
|
||||
'created_only_with_synced_attributes' => false,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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($syncedAttributes);
|
||||
$centralModel = $event->model->getCentralModelName()::create(
|
||||
config('tenancy.created_only_with_synced_attributes') ? $syncedAttributes
|
||||
: $event->model->getAttributes()
|
||||
);
|
||||
event(new SyncedResourceChangedInForeignDatabase($event->model, null));
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue