webpatser/uuid
Pure PHP UUID generator/validator for RFC 4122 and RFC 9562. Create UUID v1/3/4/5/6/7/8, nil UUIDs, import and validate strings, compare UUIDs, and access string/hex/bytes/URN/version/variant/time properties.
uuid in PostgreSQL/MySQL 8.0+), and validation rules. Supports Laravel’s HasUuids trait pattern for model-level UUID handling.uuid column type (PostgreSQL/MySQL 8.0+) and binary(16) for SQL Server.uuid validation rule (e.g., $request->validate(['id' => 'uuid'])).incrementing IDs with UUIDv7 for new models (minimal schema changes).DB::table()->update()).User::generateApiKey()).ramsey/uuid as a fallback or upgrade PHP.ramsey/uuid and monitor for updates.uuid rule?incrementing IDs with UUIDv7 for models, using HasUuids trait or custom accessors.uuid column type (native support).uniqueidentifier with toSqlServer()/importFromSqlServer() methods.binary(16) storage with custom indexing.uuid rule (e.g., $request->validate(['id' => 'uuid'])).Uuid::import($request->id) for deserialization.user:{uuid}).| Phase | Action | Tools/Methods | Risk |
|---|---|---|---|
| 1. New Models | Generate UUIDv7 for new Eloquent models. | Schema::create('users', fn($table) => $table->uuid('id')->primary()); |
Low |
| 2. Backfill | Batch-update existing tables with UUIDv7. | DB::table('users')->update(['id' => Uuid::v7()]); |
Medium (downtime risk) |
| 3. Auth Tokens | Replace sequential IDs with UUIDv4 for auth tokens. | User::generateApiKey() → Uuid::v4(). |
Low |
| 4. API Changes | Update API responses/requests to use UUID strings. | Laravel’s uuid cast for automatic conversion. |
Medium (deprecation warnings) |
| 5. Scout | Implement custom UUIDv7 string casting for searchability. | Override toSearchableArray() in models. |
High (Scout compatibility) |
| 6. Legacy | Replace UUIDv1 with UUIDv7 in legacy systems. | Uuid::generate(7) for new IDs; migrate old data. |
High (data consistency) |
ramsey/uuid.uuid type support.uuid type (requires utf8mb4 collation).toSqlServer().text or blob (no native UUID type).logs, events).Uuid::validate() to catch malformed UUIDs early.Uuid::benchmark()).How can I help you explore Laravel packages today?