Skip to content

Commit 5985f66

Browse files
feat: add ulid method to matches ids trait (#12)
1 parent 7cbe4a8 commit 5985f66

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Core/Schema/Concerns/MatchesIds.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ public function uuid(): self
5252
return $this->matchAs('[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}');
5353
}
5454

55+
/**
56+
* Mark the ID field as a ULID.
57+
*
58+
* @return $this
59+
*/
60+
public function ulid(): self
61+
{
62+
return $this->matchAs('[0-7][0-9a-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}');
63+
}
64+
5565
/**
5666
* Set the pattern for the ID field.
5767
*

0 commit comments

Comments
 (0)