ollico/laravel-uid

A handy package to generate unique identifiers for Eloquent models

Installs: 9 964

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 1

pkg:composer/ollico/laravel-uid

v6.0.0 2025-10-01 10:31 UTC

This package is auto-updated.

Last update: 2025-10-01 10:32:08 UTC


README

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.