diff --git a/src/Concerns/HasUUID.php b/src/Concerns/HasUUID.php index 9ad83b7..107eaec 100644 --- a/src/Concerns/HasUUID.php +++ b/src/Concerns/HasUUID.php @@ -12,7 +12,7 @@ trait HasUUID public static function bootHasUUID(): void { static::creating(function ($model) { - $model->uuid = Str::uuid()->toString(); + $model->uuid = $model->uuid ?? Str::uuid()->toString(); }); } }