Skip to content

Commit

Permalink
feat: add ulid method to matches ids trait (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashk2a authored Jul 20, 2023
1 parent 7cbe4a8 commit 5985f66
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Core/Schema/Concerns/MatchesIds.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ public function uuid(): self
return $this->matchAs('[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}');
}

/**
* Mark the ID field as a ULID.
*
* @return $this
*/
public function ulid(): self
{
return $this->matchAs('[0-7][0-9a-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}');
}

/**
* Set the pattern for the ID field.
*
Expand Down

0 comments on commit 5985f66

Please sign in to comment.