diff --git a/strings.md b/strings.md index 44e40ad336..2e2ef4b033 100644 --- a/strings.md +++ b/strings.md @@ -2666,6 +2666,20 @@ $result = Str::of('Taylor')->isUuid(); // false ``` +You may also validate that the given UUID matches a UUID specification by version (1, 3, 4, 5, 6, 7, or 8): + +```php +use Illuminate\Support\Str; + +$isUuid = Str::of('a0a2a2d2-0b87-4a18-83f2-2529882be2de')->isUuid(version: 4); + +// true + +$isUuid = Str::of('a0a2a2d2-0b87-4a18-83f2-2529882be2de')->isUuid(version: 1); + +// false +``` + #### `kebab` {.collection-method}