Skip to content

Commit

Permalink
Switch models to UUID v7 (#52433)
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir authored Aug 16, 2024
1 parent 87f9dd5 commit c50ee30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Concerns/HasUuids.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function uniqueIds()
*/
public function newUniqueId()
{
return (string) Str::orderedUuid();
return (string) Str::uuid7();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

use Illuminate\Support\Str;

trait HasVersion7Uuids
trait HasVersion4Uuids
{
use HasUuids;

/**
* Generate a new UUID (version 7) for the model.
* Generate a new UUID (version 4) for the model.
*
* @return string
*/
public function newUniqueId()
{
return (string) Str::uuid7();
return (string) Str::orderedUuid();
}
}

0 comments on commit c50ee30

Please sign in to comment.