So I\'ve been doing some digging around and I\'ve been trying to piece together a function that generates a valid v4 UUID in PHP. This is the closest I\'ve been able to come
Use Symfony Polyfill / Uuid Then you can just generate uuid as native php function:
$uuid = uuid_create(UUID_TYPE_RANDOM);
More about it, read in official Symfony blop post - https://symfony.com/blog/introducing-the-new-symfony-uuid-polyfill