laravel-model-uuid icon indicating copy to clipboard operation
laravel-model-uuid copied to clipboard

UUID v7 support / ULID support?

Open atymic opened this issue 2 years ago • 9 comments

Thoughts on adding v7/ulid support? https://uuid.ramsey.dev/en/stable/rfc4122/version7.html?highlight=encoding#

Happy to PR :)

atymic avatar Oct 06 '22 03:10 atymic

Happy to review a PR, but also considering that UUID/ULID support is coming to Laravel, need to consider what versions of Laravel we support into the future as well.

michaeldyrynda avatar Oct 06 '22 03:10 michaeldyrynda

Ahh ok, do you have a link to that ticket? We're going to use v7 instead of the laravel/ramsey specific v4 ordered as its an official RFC

atymic avatar Oct 06 '22 03:10 atymic

This is the PR that introduced the functionality, so it's available in Laravel 9.x.

Laravel 10.x will use UUIDv7 by default.

michaeldyrynda avatar Oct 06 '22 03:10 michaeldyrynda

What about ulid? Uuid are great, but ulids are more compact ant url friendly. Can we create ulid specific mr?

AidasK avatar Apr 08 '23 13:04 AidasK

PR'd #124

Looks like laravel reverted v7 becoming default due to BC breaks.

atymic avatar May 08 '23 07:05 atymic

Laravel 9.x has ULID support as well. https://laravel.com/docs/9.x/migrations#column-method-ulid

Methods are:

  • foreignUlid
  • nullableUlidMorphs
  • ulidMorphs
  • ulid

joelmellon avatar Sep 12 '23 16:09 joelmellon

@michaeldyrynda will you accept a ULID PR as well?

atymic avatar Sep 12 '23 23:09 atymic

PR'd #127

atymic avatar Sep 13 '23 00:09 atymic

@michaeldyrynda I know this is a little old but Laravel did revert the PR and decided not to use UUIDv7 by default. It would be nice if we could set a config to choose the default UUID instead of having to create a trait to override the default on every model.

billriess avatar Apr 03 '24 20:04 billriess