PHPackages                             juggl/unique-hashids - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. juggl/unique-hashids

Abandoned → [sven/unique-hashids](/?search=sven%2Funique-hashids)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

juggl/unique-hashids
====================

Easily create unique ids for a Laravel model.

1.1.0(10y ago)331[1 issues](https://github.com/Jugglio/UniqueHashids/issues)MITPHP

Since Dec 24Pushed 10y agoCompare

[ Source](https://github.com/Jugglio/UniqueHashids)[ Packagist](https://packagist.org/packages/juggl/unique-hashids)[ Docs](https://github.com/Jugglio/UniqueHashids)[ RSS](/packages/juggl-unique-hashids/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

> THIS VERSION IS DEPRECATED! PLEASE USE [sven/unique-hashids](https://github.com/svenluijten/unique-hashids) INSTEAD.

Unique Hashids
==============

[](#unique-hashids)

[![Latest Version on Packagist](https://camo.githubusercontent.com/60f5ca4c4a412aab6c09283751848b11b40c4819ec287b25d5634e2d9b172abf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a7567676c2f756e697175652d686173686964732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juggl/unique-hashids)[![Total Downloads](https://camo.githubusercontent.com/f6919cca36abb5c6b8b450a569450ca6a3eaee8decc55df9206968f925e608d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a7567676c2f756e697175652d686173686964732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juggl/unique-hashids)[![Software License](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This is a simple trait for [Laravel](http://laravel.com) models to generate unique ids for them. It uses [vinkla](https://github.com/vinkla)'s wonderful [Hashids](https://github.com/vinkla/hashids) package and is configurable within the model itself.

Installation
------------

[](#installation)

You may install this package via [composer](http://getcomposer.org):

```
$ composer require juggl/unique-hashids
```

Configuration
-------------

[](#configuration)

This will install both this package and [Hashids](https://github.com/vinkla/hashids). Please see the documentation over there to install &amp; configure the hashids. This package will use the default Hashids driver.

Usage
-----

[](#usage)

To start generating unique ids for your models, all you need to do is use a trait, like so:

```
namespace App;

use Juggl\UniqueHashids\GeneratesUnique;
use Illuminate\Database\Eloquent\Model;

class YourModel extends Model
{
    use GeneratesUnique;

    // The rest of your model
}
```

By default, this package assumes you have a `unique_id` column on you database to store the unique id in. Optionally, you may override this by setting a static property `$uniqueColumn` on your model:

```
namespace App;

use Juggl\UniqueHashids\GeneratesUnique;
use Illuminate\Database\Eloquent\Model;

class YourModel extends Model
{
    use GeneratesUnique;

    public static $uniqueColumn = 'my_column'; // this will assume 'unique_id' by default.

    // The rest of your model
}
```

Credits
-------

[](#credits)

This package depends on [vinkla](https://github.com/vinkla)'s excellent Hashids package, found [here](https://github.com/vinkla/hashids).

License
-------

[](#license)

`juggl\unique-hashids` is licenced under the MIT License (MIT). Please see the [license file](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

3839d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6682e025b83b7a93b4d43c5c9b0b2245d790d72352758c47b81ba14858f45a8a?d=identicon)[svenluijten](/maintainers/svenluijten)

---

Top Contributors

[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (8 commits)")

---

Tags

laravelhashidsiduniqueunique-id

### Embed Badge

![Health badge](/badges/juggl-unique-hashids/health.svg)

```
[![Health](https://phpackages.com/badges/juggl-unique-hashids/health.svg)](https://phpackages.com/packages/juggl-unique-hashids)
```

###  Alternatives

[cybercog/laravel-optimus

An Optimus bridge for Laravel. Id obfuscation based on Knuth's multiplicative hashing method.

193573.4k](/packages/cybercog-laravel-optimus)[delight-im/ids

Short, obfuscated and efficient IDs for PHP

279.9k1](/packages/delight-im-ids)[lingxi/hashids

A Hashids bridge for Laravel

183.3k](/packages/lingxi-hashids)[infocyph/uid

UUID (RFC 9562), ULID, Snowflake ID, Sonyflake ID, and TBSL generator for PHP.

115.7k](/packages/infocyph-uid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
