Maintainers

Package info

github.com/maarheeze/uuid

pkg:composer/maarheeze/uuid

Statistics

Installs: 4

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-03-17 08:14 UTC

This package is auto-updated.

Last update: 2026-03-17 08:20:13 UTC


README

A simple UUID value object for PHP.

Requirements

  • PHP 8.2+

Installation

composer require maarheeze/uuid

Usage

Generating a UUID

$uuid = Uuid::generate();

Creating from a string

$uuid = Uuid::fromString('018e4c7a-3b2f-7000-8000-000000000000');

String output

(string) $uuid;
$uuid->toString();

JSON

$uuid->jsonSerialize();
json_encode($uuid);

Uuid::jsonDeserialize(['uuid' => '018e4c7a-3b2f-7000-8000-000000000000']);

License

MIT