PHPackages                             kduma/eloquent-tokenable - 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. [Database &amp; ORM](/categories/database)
4. /
5. kduma/eloquent-tokenable

ActiveLibrary[Database &amp; ORM](/categories/database)

kduma/eloquent-tokenable
========================

Allows using tokens (HashIDs) instead of id in Laravel Eloquent models.

v1.2.0(1y ago)61762MITPHPPHP &gt;=7.4

Since Jan 31Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/kduma-OSS/LV-eloquent-tokenable)[ Packagist](https://packagist.org/packages/kduma/eloquent-tokenable)[ RSS](/packages/kduma-eloquent-tokenable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (12)Used By (0)

Eloquent Tokenable
==================

[](#eloquent-tokenable)

[![Latest Stable Version](https://camo.githubusercontent.com/050c2b871a673064edd26ee2a1f47d375bbb68a81fbdaab60935eba9cc13833f/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d746f6b656e61626c652f762f737461626c652e737667)](https://packagist.org/packages/kduma/eloquent-tokenable)[![Total Downloads](https://camo.githubusercontent.com/402beb914a2ae7ec81e070bfe95f6c7e222f3088714acdbb9f1dc01ebf87f56b/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d746f6b656e61626c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/kduma/eloquent-tokenable)[![License](https://camo.githubusercontent.com/014414ae1056ccb12e6849625ff669a129f12fc9d3c7a2044bad604cd9160f78/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d746f6b656e61626c652f6c6963656e73652e737667)](https://packagist.org/packages/kduma/eloquent-tokenable)

Eloquent trait for exposing Hashids-based tokens on Laravel models instead of numeric IDs.

Full documentation: [opensource.duma.sh/libraries/php/eloquent-tokenable](https://opensource.duma.sh/libraries/php/eloquent-tokenable)

Requirements
------------

[](#requirements)

- PHP `^8.3`
- Laravel `^13.0`

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

[](#installation)

```
composer require kduma/eloquent-tokenable
```

Usage
-----

[](#usage)

```
use KDuma\Eloquent\Tokenable;
use KDuma\Eloquent\Attributes\HasToken;

#[HasToken(length: 10)]
class Order extends Model
{
    use Tokenable;
}
```

```
$order = Order::find(1);
echo $order->token; // e.g. "k3Zx9mPqW2"

$order = Order::whereToken('k3Zx9mPqW2')->first();
```

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance69

Regular maintenance activity

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

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 ~510 days

Recently: every ~892 days

Total

8

Last Release

544d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4.0

v1.2.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/d09451622719c7efce1a7971b8e5a875859504882ba2b8c279d1015a99e8f12c?d=identicon)[kduma](/maintainers/kduma)

---

Top Contributors

[![kduma](https://avatars.githubusercontent.com/u/1062582?v=4)](https://github.com/kduma "kduma (37 commits)")

---

Tags

laravelphplaraveleloquenthashids

### Embed Badge

![Health badge](/badges/kduma-eloquent-tokenable/health.svg)

```
[![Health](https://phpackages.com/badges/kduma-eloquent-tokenable/health.svg)](https://phpackages.com/packages/kduma-eloquent-tokenable)
```

###  Alternatives

[silber/bouncer

Eloquent roles and abilities.

3.6k4.4M25](/packages/silber-bouncer)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[kirkbushell/eloquence

A set of extensions adding additional functionality and consistency to Laravel's awesome Eloquent library.

573970.0k1](/packages/kirkbushell-eloquence)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)

PHPackages © 2026

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