New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

ollico/laravel-uid

A handy package to generate unique identifiers for Eloquent models
12,881
Install
composer require ollico/laravel-uid
Latest Version:v6.0.0
PHP:^8.2
Laravel:10 · 11 · 12
Older releases:6 – 9
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 uid during the creating event

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...

651,963,193 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

518,004,183 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

435,097,283 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
v6.0.0 ^8.2 ^10.0|^11.0|^12.0 MIT
v5.0.1 ^8.2 ^10.0|^11.0 MIT
v5.0.0 ^8.2 ^10.0|11.0 MIT
v4.0.0 ^8.2 ^10.0 MIT
v3.0.0 ^8.1 ^9.0 MIT