snortlin/nano-id
Laravel-friendly NanoID generator for PHP: create short, URL-safe, collision-resistant IDs with configurable length and alphabet. Simple API, lightweight and fast—ideal for public identifiers, tokens, and model keys without exposing sequential IDs.
UNIQUE constraints or retry logic).Str::uuid() or Str::random() for specific use cases.UNIQUE constraints or application logic to handle collisions (e.g., retry on duplicate).CHAR vs. VARCHAR types).UNIQUE constraints on NanoIDs can cause lock contention under heavy load.CHAR(21) vs. VARCHAR(21); indexed vs. non-indexed).find()) that assume sequential IDs?NanoIdGenerator) for dependency injection.NanoId::generate()).setAttribute('slug', fn() => NanoId::generate())).creating) to auto-generate IDs.Str::random(32) with NanoId::generate(10) for shorter, URL-friendly tokens.NanoId class (if exposed) for standalone PHP apps.BIGINT primary keys with CHAR(21) (or desired length) for NanoIDs.UNIQUE constraints on NanoID columns (test under load).Str::uuid()) with NanoId::generate().ORDER BY id) to use alternative patterns (e.g., ORDER BY created_at).UNIQUE constraints (MySQL, PostgreSQL, SQLite, etc.).Str::uuid()).config/nano-id.php).UNIQUE constraints may require future migrations.NanoId::generate(10) is self-documenting).UNIQUE constraints on NanoIDs may cause lock contention under extreme write loads (mitigate with batching or async generation).How can I help you explore Laravel packages today?