Skip to content

Commit

Permalink
Fixed UUID trait
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoxavier committed Nov 5, 2024
1 parent cb5d50b commit 9027c54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Concerns/HasUUID.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
}

0 comments on commit 9027c54

Please sign in to comment.