Skip to content

ramsey/uuid

A PHP library for generating and working with UUIDs (unique identifiers).ramsey/uuid

Stars
12.6k
Forks
533
Licence
MIT
Language
PHP
Last update
2 months ago
Type
Library

What it is

ramsey/uuid is a PHP code library that creates and handles UUIDs, which are long random-looking identifiers used to tag records or objects so they stay unique across systems. Developers add it to a PHP project to generate these IDs instead of writing that logic themselves. The README says it was inspired by the Java and Python UUID libraries.

  • Generate a new UUID for a database primary key in a PHP application
  • Create identifiers for objects passed between services
  • Work with existing UUID strings in a PHP codebase

Great for

  • PHP developers who need unique IDs for database records or API objects
  • Projects that already use Composer to manage PHP dependencies
  • Teams looking for a long-established, MIT-licensed UUID library

Not ideal for

  • People who do not write PHP code, since it is a library rather than a standalone app
  • Projects that need a different language's UUID tooling, since this is PHP only
Step-by-step guide: how to use ramsey/uuidInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: PHP · Composer

    Install the package with Composer

    composer require ramsey/uuid
  2. 2

    Run it

    • Install the package with Composer using the command above
    • Add the library to your PHP code by loading Composer's autoloader
    • Call the library's UUID generation functions from your code
    • Check https://uuid.ramsey.dev for usage examples
  3. 3

    Get the most out of it

    • Read the upgrade guide if you are moving from version 3 to 4
    • Review the documentation site for examples and frequently asked questions
    • Follow the CONTRIBUTING.md file if you want to report issues or submit changes

Downloads

Strengths

  • MIT license, permissive for commercial and personal use
  • Installs through Composer, the standard PHP package manager
  • Documentation site with examples and an upgrade guide from version 3 to 4

Trade-offs

  • Only usable from PHP; the README does not describe other language ports
  • The README is short, so detailed API behavior has to be checked in the external documentation
  • Upgrading from version 3 requires following a separate migration guide

How it compares

ProjectStarsTypeLevelUpdatedBest for
uuid (this)12.6kLibrarybeginner2 months agoPHP developers who need unique IDs for database records or API objects
DesignPatternsPHP22.2kLearning resourcebeginner1.8 years agoPHP developers learning object-oriented design patterns
CodeIgniter18.2kFrameworkintermediate2.3 years agoPHP developers who want a framework with a relatively small footprint
guzzle23.4kLibraryintermediate12 days agoPHP developers who need to call external REST or web service APIs
monolog21.4kLibraryintermediate5 days agoPHP developers who need structured logs from an application
flysystem13.6kLibraryintermediate1 months agoPHP developers who need to store files in more than one place

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.