webpatser/laravel-uuid
Laravel package for generating and working with UUIDs. Provides a UUID model trait, helpers to create v1/v4 UUIDs, and integrates with Eloquent so models can use UUID primary keys instead of auto-increment IDs.
uniqueidentifier integration, enabling gradual migration from monolithic systems to microservices while maintaining compatibility with existing databases.Str::uuid()). Reduces technical debt compared to custom implementations.Adopt if:
uniqueidentifier support with byte-order handling.Look elsewhere if:
ramsey/uuid or voku/uuid as a standalone library).Str::uuid() suffices).webpatser/uuid).webpatser/uuid package is actively updated).For Executives: *"This package lets us eliminate ID conflicts in distributed systems, a critical bottleneck as we scale [product name] globally. By replacing auto-increment IDs with UUIDs, we:
uniqueidentifier support.
The performance boost (15–25% faster UUID generation) is an added bonus for our [high-throughput] pipelines. This is a low-risk, high-reward upgrade that aligns with our [scaling/compliance/tech debt] goals."*For Engineering: *"This is a Laravel-native UUID power-up that:
Str::uuid() with optimized methods (fastUuid(), timeBasedUuid(), etc.)—15–25% faster than built-in Laravel.BinaryUuidMigrations::uuid($table), and it picks the right column type (binary for MySQL/PostgreSQL, string for SQLite/SQL Server).uniqueidentifier out of the box, including byte-order conversion for mixed environments.HasBinaryUuids trait for seamless model binding, route model binding, and foreign keys.Key Tradeoffs:
AppServiceProviders or API middleware.DatabaseService to handle conversions.Next Steps:
Str::fastUuid() vs. current UUID generation in our bulk operations (e.g., seeders, event batching).audit_logs) to binary UUIDs and measure storage/index size.UUID_MIGRATION_GUIDE.md for the team with database-specific examples."*For Security/Compliance Teams: *"UUIDs eliminate metadata leaks in auto-increment IDs, which can expose:
How can I help you explore Laravel packages today?