Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Conciseuuid

Conciseuuid Laravel Package

phpexperts/conciseuuid

ConciseUUID is a PHP package for generating compact, URL-safe UUIDs. It encodes standard UUIDs as shorter Base62 strings, cutting identifier length for URLs, databases, and APIs while preserving uniqueness. Simple API works in Laravel or any PHP project.

View on GitHub
Deep Wiki
Context7

A ConciseUuid Model for Eloquent / Laravel.

Frequently asked questions about Conciseuuid
How do I install phpexperts/conciseuuid in a Laravel application?
Install it with Composer using composer require phpexperts/conciseuuid. It is a small utility package with a narrow Eloquent surface area, so setup is typically just the package plus its model trait or base class. Follow the repository README for the exact model wiring, and check the composer.json constraints against your Laravel and PHP versions before using it in production.
How do I use ConciseUUID as an Eloquent model primary key?
Apply the package trait or extend its base model on the Eloquent model whose primary key you want to be a 22-character Base62 UUID. The trait hooks into model creation to populate the key, and you should confirm that the model sets $incrementing to false and $keyType to string. Add a matching fixed-width string column in your migration so the database type lines up with the generated value.
What column type should I use for a ConciseUUID primary key in MySQL or Postgres?
Use a fixed-width string sized for the 22-character output, such as CHAR(22) CHARACTER SET ascii on MySQL or a varchar equivalent on Postgres. Fixed-width CHAR keeps index pages predictable compared with variable-length types. Every foreign key referencing the primary key must use the identical type and collation, otherwise joins and index usage will suffer.
Does ConciseUUID generate UUID v4 or UUID v7, and are the IDs sortable?
The package documentation provided does not state whether it generates UUID v4 or v7, so inspect the source or README before relying on ordering behavior. Base62 encoding of a random v4 UUID preserves randomness but is not monotonically increasing, so IDs will not be sortable. If time-ordered keys matter for your workload, evaluate a ULID or UUIDv7-based approach instead.
Can I use ConciseUUID with bulk inserts, upsert, or insertOrIgnore?
Eloquent's creating event, which model traits typically rely on, does not fire for bulk operations such as insert(), insertOrIgnore(), and upsert(), so keys may not be generated on those paths. Generate ConciseUUID values explicitly in the arrays you pass to bulk queries, or avoid bulk inserts for these models. Test upsert behavior in your own application before depending on it.
Should I migrate an existing table from integer or UUID keys to ConciseUUID?
Do not retrofit existing tables as a package swap; treat it as a data migration project with a shadow column, dual writes, backfill, cutover, and foreign key rebuilds. The realistic path is to adopt ConciseUUID only on new, low-criticality tables first and to standardize the schema convention before expanding. Benchmark insert throughput and index size against integer and standard-UUID baselines on your actual database engine.
Which Laravel and PHP versions does ConciseUUID support?
Support ranges are defined in the package's composer.json, so compare its require constraints with your target Laravel major version and PHP version. Because the package is small and single-maintainer, its pinned ranges may lag behind the latest Laravel release. Verify compatibility in a non-production environment before committing to it.
Does ConciseUUID have tests and active maintenance?
Check the repository for a test suite, recent commit activity, and whether CI runs on the default branch before adopting it. With a low star count and no evidence of a broad dependent base, maintenance risk is the main concern for a package sitting in your primary key path. Treat it as a concentrated dependency and keep a fallback plan for switching key generation strategies.
Are Base62 UUID primary keys bad for MySQL InnoDB index performance?
Random string primary keys are not monotonically increasing, so InnoDB B-tree pages split and fragment more than with sequential integers. Base62 shortens the key from 36 to 22 characters, which reduces index size versus standard UUIDs, but it does not fix insert ordering. Postgres and newer MySQL versions tolerate this better; benchmark insert throughput and index size on your engine and write volume.
What are alternatives to ConciseUUID for shorter Laravel primary keys?
Common alternatives include auto-increment bigints, which are short but guessable and coordination-heavy, and standard UUIDs, which are 36 characters and index-hostile. ULIDs and UUIDv7 provide time-ordered, index-friendlier identifiers, while hashids-style obfuscation can shorten integer keys for URLs. Choose based on whether you need distributed generation, sortability, or simply shorter identifiers.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console