Skip to main content

Installation

⚙️ Requirements

  • PHP 8.4 or 8.5

📦 Install via Composer

You can install the DomainFlow\Uuid package using Composer:

composer require domainflow/uuid

Usage

After installation, you can import and use the classes like this:

use DomainFlow\Uuid\UuidV4;

$uuid = UuidV4::generate(); // generates a new UUID v4
echo (string) $uuid;

Or use the Inspector utility to analyze UUIDs:

use DomainFlow\Uuid\Inspector;

$inspector = Inspector::analyze('f47ac10b-58cc-4372-a567-0e02b2c3d479');
echo $inspector->version(); // Output: 4

Every UUID class also shares the same set of methods for comparison, string conversion, and JSON (de)serialization — see Shared Methods for fromString(), equals(), jsonSerialize(), and fromJson().

That’s it — you’re ready to start working with powerful, version-aware UUIDs in DomainFlow.