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

Merge pull request #1 from amirakbulut/GeneratesIds-patch

Modified GeneratesIds.php
This commit is contained in:
amirakbulut 2020-08-03 14:22:44 +02:00 committed by GitHub
commit dd00f188d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,8 +11,8 @@ trait GeneratesIds
public static function bootGeneratesIds() public static function bootGeneratesIds()
{ {
static::creating(function (self $model) { static::creating(function (self $model) {
if (! $model->getTenantKey() && $model->shouldGenerateId()) { if (!$model->getKey() && $model->shouldGenerateId()) {
$model->setAttribute($model->getTenantKeyName(), app(UniqueIdentifierGenerator::class)->generate($model)); $model->setAttribute($model->getKeyName(), app(UniqueIdentifierGenerator::class)->generate($model));
} }
}); });
} }