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

self review

This commit is contained in:
Abrar Ahmad 2022-11-03 11:13:49 +05:00
parent 3ec39b3445
commit 2cc40e0b81
2 changed files with 6 additions and 5 deletions

View file

@ -150,10 +150,11 @@ class UpdateSyncedResource extends QueueableListener
if (Arr::isAssoc($model->getSyncedCreationAttributes())) { if (Arr::isAssoc($model->getSyncedCreationAttributes())) {
// Developer provided the default values (key => value) or mix of default values and attribute names (values only) // Developer provided the default values (key => value) or mix of default values and attribute names (values only)
// We will merge the default values with sync attributes // We will merge the default values with provided attributes and sync attributes
[$attributes, $defaultValues] = $this->getAttributeNamesAndDefaultValues($model); [$attributeNames, $defaultValues] = $this->getAttributeNamesAndDefaultValues($model);
$attributes = $model->only(array_merge($model->getSyncedAttributeNames(), $attributeNames));
return array_merge($model->only(array_merge($model->getSyncedAttributeNames(), $attributes)), $defaultValues); return array_merge($attributes, $defaultValues);
} }
// Developer provided the attribute names, so we'll use them to pick model attributes // Developer provided the attribute names, so we'll use them to pick model attributes

View file

@ -784,10 +784,10 @@ function createTenantsAndRunMigrations(): array
/** /**
* Run tenant migrations using the tenants:migrate command. * Run tenant migrations using the tenants:migrate command.
*/ */
function migrateTenantsResource(?string $path = null): void function migrateTenantsResource(): void
{ {
pest()->artisan('tenants:migrate', [ pest()->artisan('tenants:migrate', [
'--path' => $path ?? __DIR__ . '/Etc/synced_resource_migrations/users', '--path' => __DIR__ . '/Etc/synced_resource_migrations/users',
'--realpath' => true, '--realpath' => true,
])->assertExitCode(0); ])->assertExitCode(0);
} }