Laravel's Str::orderedUuid()
function has existed since 2018(Laravel v5.6) originally trying to fix problems with UUID v4. More details on Str::orderedUuid
implementation can be found in this blog post.
In contrast, UUID v7 is also relatively recently introduced to reach similar goals. But keep in mind that UUID v7 has been made a standard only this year with the publication of RFC 9562 in May 2024.
So to answer your question on why Laravel HasUuids
preferred its own implementation could simply be that it predates v7 becoming the standard.
Like always to still give you flexibility, Laravel v11 gives you the trait Illuminate\Database\Eloquent\Concerns\HasVersion7Uuids
as another answer also suggested which lets you use the new standard without breaking existing code bases.
I would like you to note that both are timestamp-based and both are lexicographically ordered and for general use cases are similar in use, the difference being one is a standard now and the other is not.