File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,16 @@ public function isUuid()
320
320
return Str::isUuid ($ this ->value );
321
321
}
322
322
323
+ /**
324
+ * Determine if a given string is a valid ULID.
325
+ *
326
+ * @return bool
327
+ */
328
+ public function isUlid ()
329
+ {
330
+ return Str::isUlid ($ this ->value );
331
+ }
332
+
323
333
/**
324
334
* Determine if the given string is empty.
325
335
*
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ public function testIsUuid()
39
39
$ this ->assertFalse ($ this ->stringable ('2cdc7039-65a6-4ac7-8e5d-d554a98 ' )->isUuid ());
40
40
}
41
41
42
+ public function testIsUlid ()
43
+ {
44
+ $ this ->assertTrue ($ this ->stringable ('01GJSNW9MAF792C0XYY8RX6QFT ' )->isUlid ());
45
+ $ this ->assertFalse ($ this ->stringable ('01GJSNW9MAF-792C0XYY8RX6ssssss-QFT ' )->isUlid ());
46
+ }
47
+
42
48
public function testIsJson ()
43
49
{
44
50
$ this ->assertTrue ($ this ->stringable ('1 ' )->isJson ());
You can’t perform that action at this time.
0 commit comments