ollico/laravel-uid
A handy package to generate unique identifiers for Eloquent models
12,735
| Install | |
|---|---|
composer require ollico/laravel-uid |
|
| Latest Version: | v6.0.0 |
| PHP: | ^8.2 |
| Laravel: | 10 · 11 · 12 |
| License: | MIT |
| Last Updated: | Jan 28, 2026 |
| Links: | GitHub · Packagist |
Maintainer: davidianbonner
UID Helper
A handy little Laravel compatible package that creates unique identifiers like u5CVsCnxyXg for your Eloquent models.
Installation
Require this package
composer require ollico/uid
Usage
Configuration
Database
Add the $table->uid() in your Schemas:
Schema::create('your_table', function (Blueprint $table) {
$table->uid();
})
Eloquent
Add the HasUid trait to your Models to add the capabilities:
- Local scope
$model->uid($uid) - Automatic generation of
uidduring thecreatingevent
Good to know
We utilise HashIds under the hood.
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
641,106,524
9,700
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
418,291,778
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
394,964,158
4,660
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v6.0.0 | ^8.2 | ^10.0| | MIT | |
| v5.0.1 | ^8.2 | ^10.0| | MIT | |
| v5.0.0 | ^8.2 | ^10.0| | MIT | |
| v4.0.0 | ^8.2 | ^10.0 | MIT | |
| v3.0.0 | ^8.1 | ^9.0 | MIT | |
| v2.0.0 | ^8.1 | ^8.0 | MIT | |
| 1.0.3 | ^7.3 | ^6.0 | | MIT | |
| 1.0.2 | ^7.3 | ^6.0 | | MIT | |
| 1.0.0 | ^7.3 | >=7.0 | MIT |