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 @@ -258,6 +258,16 @@ public function isAscii()
258
258
return Str::isAscii ($ this ->value );
259
259
}
260
260
261
+ /**
262
+ * Determine if a given string is a valid UUID.
263
+ *
264
+ * @return bool
265
+ */
266
+ public function isUuid ()
267
+ {
268
+ return Str::isUuid ($ this ->value );
269
+ }
270
+
261
271
/**
262
272
* Determine if the given string is empty.
263
273
*
Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ public function testIsAscii()
31
31
$ this ->assertFalse ($ this ->stringable ('ù ' )->isAscii ());
32
32
}
33
33
34
+ public function testIsUuid ()
35
+ {
36
+ $ this ->assertTrue ($ this ->stringable ('2cdc7039-65a6-4ac7-8e5d-d554a98e7b15 ' )->isUuid ());
37
+ $ this ->assertFalse ($ this ->stringable ('2cdc7039-65a6-4ac7-8e5d-d554a98 ' )->isUuid ());
38
+ }
39
+
34
40
public function testIsEmpty ()
35
41
{
36
42
$ this ->assertTrue ($ this ->stringable ('' )->isEmpty ());
You can’t perform that action at this time.
0 commit comments