PHPackages                             specs/hashids-laravel - 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. specs/hashids-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

specs/hashids-laravel
=====================

A hashids (hashids) wrapper for Laravel

0.1.2(9y ago)21.9k↓47.3%1MITPHPPHP &gt;=5.3.0

Since Jun 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/9IPHP/hashids-laravel)[ Packagist](https://packagist.org/packages/specs/hashids-laravel)[ Docs](https://github.com/specs/hashids-laravel)[ RSS](/packages/specs-hashids-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Hashids for Laravel
===================

[](#hashids-for-laravel)

A hashids (hashids) wrapper for Laravel.

[Hashids](https://github.com/ivanakimov/hashids.php) is a small PHP class to generate YouTube-like ids from one or many numbers. Use hashids when you do not want to expose your database ids to the user.

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

[](#installation)

require package in `composer.json`

```
"require": {
    "specs/hashids-laravel": "^0.1"
},
```

add hashids’s service provider in `config/app.php`

```
'providers' => array(

    Illuminate\Validation\ValidationServiceProvider::class,
    ...
    Illuminate\View\ViewServiceProvider::class,

    Specs\Hashids\HashidsServiceProvider::class,
),
```

and hashids’s facade (also in `config/app.php`)

```
'aliases' => array(

    'App' => Illuminate\Support\Facades\App::class,
    ...
    'View' => Illuminate\Support\Facades\View::class,

    'Hashids' => Specs\Hashids\HashidsFacade::class,

),
```

You should also publish the config file.

```
php artisan vendor:publish --tag=config
```

And then reset the default values in `config/hashids.php`.

Example Usage
-------------

[](#example-usage)

Use `Hashids` Facade:

```
$id = Hashids::encode(1, 2, 3);
$numbers = Hashids::decode($id);

var_dump($id, $numbers);
```

```
string(5) "laHquq"
array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}

```

[More usage](http://hashids.org/php/)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

3

Last Release

3611d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/189a93889620569d362c9426742375fcd7655b340a8c172620327a06a7147466?d=identicon)[Specs](/maintainers/Specs)

---

Tags

phplaravelhashhashidsintegerlaravel 5id

### Embed Badge

![Health badge](/badges/specs-hashids-laravel/health.svg)

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

###  Alternatives

[vinkla/hashids

A Hashids bridge for Laravel

2.1k13.3M73](/packages/vinkla-hashids)[cybercog/laravel-optimus

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

192564.1k](/packages/cybercog-laravel-optimus)[deligoez/laravel-model-hashid

Generate, Save, and Route Stripe/Youtube-like Hash IDs for Laravel Eloquent Models

16498.0k](/packages/deligoez-laravel-model-hashid)[unicodeveloper/laravel-emoji

A Laravel 5 Package for Using &amp; Working With Emojis

21024.9k](/packages/unicodeveloper-laravel-emoji)[balping/laravel-hashslug

Package providing a trait to use Hashids on a model

25185.2k2](/packages/balping-laravel-hashslug)[delight-im/ids

Short, obfuscated and efficient IDs for PHP

289.5k1](/packages/delight-im-ids)

PHPackages © 2026

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