# Register Bundle

If you're using Symfony Flex (opens new window), this step has been done automatically for you. If not, you can register the bundle yourself:

// config/bundles.php

return [
    // Other bundles ...
    EonX\EasyRandom\Bridge\Symfony\EasyRandomBundle::class => ['all' => true],

# UUID V4 Generator

In the case you want to generate UUID V4 in your application, you will need to set the UUID V4 generator of your choice onto the random generator instance. To do so, you will first need to register the UUID V4 generator of your choice as a service and, then set the service id into the bundle configuration.

# Register UUID V4 generator as a service

By default, this package will register the built-in supported implementations as services:

  • easy_random.ramsey_uuid4 alias for EonX\EasyRandom\UuidV4\RamseyUuidV4Generator
  • easy_random.symfony_uuid4 alias for EonX\EasyRandom\UuidV4\SymfonyUidUuidV4Generator

# Set the service id into the bundle configuration

# config/packages/easy_random.yaml

    uuid_v4_generator: EonX\EasyRandom\UuidV4\RamseyUuidV4Generator # The service id