mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 09:04:03 +00:00
Merge pull request #1 from amirakbulut/GeneratesIds-patch
Modified GeneratesIds.php
This commit is contained in:
commit
dd00f188d4
1 changed files with 2 additions and 2 deletions
|
|
@ -11,8 +11,8 @@ trait GeneratesIds
|
|||
public static function bootGeneratesIds()
|
||||
{
|
||||
static::creating(function (self $model) {
|
||||
if (! $model->getTenantKey() && $model->shouldGenerateId()) {
|
||||
$model->setAttribute($model->getTenantKeyName(), app(UniqueIdentifierGenerator::class)->generate($model));
|
||||
if (!$model->getKey() && $model->shouldGenerateId()) {
|
||||
$model->setAttribute($model->getKeyName(), app(UniqueIdentifierGenerator::class)->generate($model));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue