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

Remove unnecessary check

This commit is contained in:
Leandro Guindani Gehlen 2022-08-25 17:21:24 -03:00
parent 9155e32ba8
commit d7305952e0

View file

@ -20,10 +20,10 @@ trait ResourceSyncing
}); });
static::creating(function (self $model) { static::creating(function (self $model) {
$key = $model->getGlobalIdentifierKeyName(); $keyName = $model->getGlobalIdentifierKeyName();
if (! $model->getAttribute($key) && app()->bound(UniqueIdentifierGenerator::class) && $model->isSyncEnabled()) { if (! $model->getAttribute($keyName) && app()->bound(UniqueIdentifierGenerator::class)) {
$model->setAttribute($key, app(UniqueIdentifierGenerator::class)->generate($model)); $model->setAttribute($keyName, app(UniqueIdentifierGenerator::class)->generate($model));
} }
}); });
} }