Skip to content

[12.x] Add UUID v7 section for Models to upgrade guide #10204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 25, 2025
Merged

[12.x] Add UUID v7 section for Models to upgrade guide #10204

merged 3 commits into from
Feb 25, 2025

Conversation

HasanQQ
Copy link
Contributor

@HasanQQ HasanQQ commented Feb 25, 2025

With laravel 12, the HasUuids trait using v7 UUIDs by default. If we compare the examples below, the order of the database records may become confusing.

Str::orderedUuid()
Ramsey\Uuid\Rfc4122\UuidV4 {#5343
  uuid: "9e4bb9bd-f73d-41c2-aecf-8c9bf81eb188",
}

Str::uuid7()
Ramsey\Uuid\Lazy\LazyUuidFromString {#5295
  uuid: "01953cbc-ceac-73a4-9829-a14fc6528306",
}

I'm not sure about my writing style, but I think there should be such a section in the upgrade documentation.

@nshiro
Copy link
Contributor

nshiro commented Feb 25, 2025

We should also mention that the HasVersion7Uuids trait was removed in Laravel 12.
If you are using it, you should migrate to the HasUuids trait.
laravel/framework#52433

@taylorotwell taylorotwell merged commit 6c2fd51 into laravel:12.x Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants