Looking to hire Laravel developers? Try LaraJobs

laravel-uid maintained by ollico

Description
A handy package to generate unique identifiers for Eloquent models
Last update
2025/10/01 12:31 (dev-master)
License
Links
Downloads
13 002

Comments
comments powered by Disqus

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.