Skip to content

Commit ca7970e

Browse files
authored
[10.x] Stick with ordered uuid (#44311)
* stick with ordered uuid * stick with v4 as default * Update Str.php
1 parent f79aeb8 commit ca7970e

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
@@ -29,7 +29,7 @@ public static function bootHasUuids()
2929
*/
3030
public function newUniqueId()
3131
{
32-
return (string) Str::uuid();
32+
return (string) Str::orderedUuid();
3333
}
3434

3535
/**

src/Illuminate/Support/Str.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,15 +1217,15 @@ public static function wordCount($string, $characters = null)
12171217
}
12181218

12191219
/**
1220-
* Generate a UUID (version 7).
1220+
* Generate a UUID (version 4).
12211221
*
12221222
* @return \Ramsey\Uuid\UuidInterface
12231223
*/
12241224
public static function uuid()
12251225
{
12261226
return static::$uuidFactory
12271227
? call_user_func(static::$uuidFactory)
1228-
: Uuid::uuid7();
1228+
: Uuid::uuid4();
12291229
}
12301230

12311231
/**
@@ -1235,7 +1235,7 @@ public static function uuid()
12351235
*/
12361236
public static function orderedUuid()
12371237
{
1238-
return Str::uuid();
1238+
return Uuid::uuid7();
12391239
}
12401240

12411241
/**

0 commit comments

Comments
 (0)