Skip to content

Commit c50ee30

Browse files
authored
Switch models to UUID v7 (#52433)
1 parent 87f9dd5 commit c50ee30

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Illuminate/Database/Eloquent/Concerns/HasUuids.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function uniqueIds()
3434
*/
3535
public function newUniqueId()
3636
{
37-
return (string) Str::orderedUuid();
37+
return (string) Str::uuid7();
3838
}
3939

4040
/**

src/Illuminate/Database/Eloquent/Concerns/HasVersion7Uuids.php renamed to src/Illuminate/Database/Eloquent/Concerns/HasVersion4Uuids.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
use Illuminate\Support\Str;
66

7-
trait HasVersion7Uuids
7+
trait HasVersion4Uuids
88
{
99
use HasUuids;
1010

1111
/**
12-
* Generate a new UUID (version 7) for the model.
12+
* Generate a new UUID (version 4) for the model.
1313
*
1414
* @return string
1515
*/
1616
public function newUniqueId()
1717
{
18-
return (string) Str::uuid7();
18+
return (string) Str::orderedUuid();
1919
}
2020
}

0 commit comments

Comments
 (0)