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(10y ago)22.0k↓90.3%1MITPHPPHP &gt;=5.3.0

Since Jun 29Pushed 10y 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 2d 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 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

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

3656d 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.1k14.2M77](/packages/vinkla-hashids)[deligoez/laravel-model-hashid

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

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

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

195578.5k](/packages/cybercog-laravel-optimus)[unicodeveloper/laravel-emoji

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

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

Package providing a trait to use Hashids on a model

25191.7k2](/packages/balping-laravel-hashslug)[victorybiz/geoip-location

Get the geographical location of website visitors based on their IP addresses. Support Laravel and PHP (Non-Laravel) Project.

23167.8k2](/packages/victorybiz-geoip-location)

PHPackages © 2026

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