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
Laravel Ulid

Laravel Ulid Laravel Package

rorecek/laravel-ulid

rorecek/laravel-ulid adds ULID support to Laravel apps, making it easy to generate lexicographically sortable, URL-safe identifiers and use them with Eloquent models. A lightweight alternative to UUIDs for primary keys and other unique IDs.

View on GitHub
Deep Wiki
Context7

Laravel package for ULID (Universally Unique Lexicographically Sortable Identifier)

Frequently asked questions about Laravel Ulid
What is rorecek/laravel-ulid used for?
rorecek/laravel-ulid is a Laravel package for generating and using ULIDs, which are lexicographically sortable, URL-safe identifiers. It is aimed at Eloquent models and other unique ID needs where you want sortable IDs instead of random UUIDs or auto-increment values. It is a narrow utility package, not a full architecture component.
How do I install rorecek/laravel-ulid?
Install it with Composer using composer require rorecek/laravel-ulid, then confirm that Laravel package auto-discovery picks it up or register the service provider manually if needed. After installation, run a quick proof of concept on one model or a test route before applying it broadly. Check the package constraints against your Laravel and PHP versions during installation.
Does rorecek/laravel-ulid work with Eloquent models and primary keys?
Yes, its intended use is to make ULIDs available for Eloquent models, including primary keys and public resource identifiers. Before adopting it, verify whether the package supplies an Eloquent trait, cast, or generator helper and how it handles key incrementing and key types. Test creation, route binding, and JSON serialization on one model.
Which Laravel and PHP versions are supported by rorecek/laravel-ulid?
The supported Laravel and PHP versions depend on the package's composer.json constraints, so check those before installing. Because this is a small, niche package, confirm that your Laravel version is explicitly covered rather than assuming compatibility. Pin the package version and include it in your Laravel and PHP upgrade testing.
How should I store ULIDs in MySQL, PostgreSQL, or SQLite?
ULIDs are commonly stored as a 26-character string, but you can also use a binary format depending on your database and query needs. Text storage is easier to debug and query ad hoc, while binary storage can reduce index size but complicates inspection. Decide the column type and collation deliberately for MySQL, PostgreSQL, and SQLite before creating tables.
Are ULIDs from rorecek/laravel-ulid sortable and URL-safe?
ULIDs are designed to be lexicographically sortable and URL-safe, which is why they are attractive for primary keys and public IDs. Sorting is reliable at the timestamp level, but you should verify monotonic behavior within the same millisecond and across workers if strict ordering matters. Also confirm database collation does not change expected sort order.
Can I use rorecek/laravel-ulid for route model binding and validation?
Route model binding and validation support depend on what the package provides, such as a cast, validation rule, or route key configuration. Check the README and source to confirm those integrations exist before relying on them. If they are missing, you can add a small validation rule or custom route binding in your application.
Is rorecek/laravel-ulid a good alternative to UUIDs for Laravel primary keys?
It can be a good alternative when you want sortable, URL-safe identifiers and better index locality than random UUIDv4 values. It is not a drop-in replacement for every existing primary key, especially on legacy tables. Use it for new tables or public IDs first, and plan migrations carefully if you want to change existing keys.
Is rorecek/laravel-ulid production-ready and actively maintained?
The package is MIT licensed and has a small code footprint, but it is a niche project with limited community scrutiny and likely single-maintainer concentration. Review its test coverage, CI status, recent commits, and compatibility with current Laravel releases before production use. Pin the version and define a fallback or fork plan if maintenance stalls.
How do I migrate an existing Laravel table to ULIDs with rorecek/laravel-ulid?
Start by adding a nullable ULID column alongside the existing key, backfill it deterministically, and update reads and writes behind a feature flag. Avoid rewriting primary keys in place unless the product benefit is clear and you have tested rollback. Once the new column is stable, decide whether to promote it to the primary key or keep it as a public identifier.
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