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()
258258 return Str::isAscii ($ this ->value );
259259 }
260260
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+
261271 /**
262272 * Determine if the given string is empty.
263273 *
Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ public function testIsAscii()
3131 $ this ->assertFalse ($ this ->stringable ('ù ' )->isAscii ());
3232 }
3333
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+
3440 public function testIsEmpty ()
3541 {
3642 $ this ->assertTrue ($ this ->stringable ('' )->isEmpty ());
You can’t perform that action at this time.
0 commit comments