Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit 7a68acc

Browse files
committed
fix: make UUID fillable at entity creation using UUID scope trait
1 parent 76f1649 commit 7a68acc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Support/UuidScopeTrait.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ protected static function boot()
2727
parent::boot();
2828

2929
static::creating(function ($model) {
30-
$model->uuid = Uuid::generate()->string;
30+
if (empty($model->uuid)) {
31+
$model->uuid = Uuid::generate()->string;
32+
}
3133
});
3234
}
3335
}

0 commit comments

Comments
 (0)