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

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

supernova3339/laravel-hashids
=============================

A Hashids bridge for Laravel

10.0.1(4y ago)08MITPHPPHP ^8.0

Since Feb 5Pushed 3y agoCompare

[ Source](https://github.com/Supernova3339/laravel-hashids)[ Packagist](https://packagist.org/packages/supernova3339/laravel-hashids)[ RSS](/packages/supernova3339-laravel-hashids/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (9)Versions (28)Used By (0)

[![hashids](https://cloud.githubusercontent.com/assets/499192/11159205/faa429ae-8a5d-11e5-8c5d-c60a89290c5e.png)](https://cloud.githubusercontent.com/assets/499192/11159205/faa429ae-8a5d-11e5-8c5d-c60a89290c5e.png)

Laravel Hashids
===============

[](#laravel-hashids)

> A [Hashids](http://hashids.org) bridge for Laravel.

```
// Encode integers.
Hashids::encode(4815162342);

// Decode strings.
Hashids::decode('1LLb3b4ck');

// Dependency injection example.
$hashidsManager->encode(911);
```

[![Build Status](https://camo.githubusercontent.com/d1facbb9b07ce873a12f06847c38a9fe07512c0d9ca0ecc8e3c3e0d7f7e2cc61/68747470733a2f2f62616467656e2e6e65742f6769746875622f636865636b732f76696e6b6c612f6c61726176656c2d686173686964733f6c6162656c3d6275696c642669636f6e3d676974687562)](https://github.com/vinkla/laravel-hashids/actions)[![Monthly Downloads](https://camo.githubusercontent.com/d4bb926cf2de4996a03c5c9add32beae03f38c77f4193230bc3aa4f873a695ad/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f646d2f76696e6b6c612f68617368696473)](https://packagist.org/packages/vinkla/hashids/stats)[![Latest Version](https://camo.githubusercontent.com/4cdf7e3416e93114cc5450e4e7aeffd54e1f71ad0f937e94871d1e2c20f60d97/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f76696e6b6c612f68617368696473)](https://packagist.org/packages/vinkla/hashids)

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

[](#installation)

Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

```
composer require vinkla/hashids
```

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

[](#configuration)

Laravel Hashids requires connection configuration. To get started, you'll need to publish all vendor assets:

```
$ php artisan vendor:publish
```

This will create a `config/hashids.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

#### Default Connection Name

[](#default-connection-name)

This option `default` is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is `main`.

#### Hashids Connections

[](#hashids-connections)

This option `connections` is where each of the connections are setup for your application. Example configuration has been included, but you may add as many connections as you would like.

Usage
-----

[](#usage)

Here you can see an example of you may use this package. Out of the box, the default adapter is `main`. After you enter your authentication details in the config file, it will just work:

```
// You can alias this in config/app.php.
use Vinkla\Hashids\Facades\Hashids;

// We're done here - how easy was that, it just works!
Hashids::encode(4815162342);

// This example is simple and there are far more methods available.
Hashids::decode('doyouthinkthatsairyourebreathingnow');
```

The manager will behave like it is a `Hashids\Hashids` class. If you want to call specific connections, you can do that with the connection method:

```
use Vinkla\Hashids\Facades\Hashids;

// Writing this...
Hashids::connection('main')->encode($id);

// ...is identical to writing this
Hashids::encode($id);

// and is also identical to writing this.
Hashids::connection()->encode($id);

// This is because the main connection is configured to be the default.
Hashids::getDefaultConnection(); // This will return main.

// We can change the default connection.
Hashids::setDefaultConnection('alternative'); // The default is now alternative.
```

If you prefer to use dependency injection over facades, then you can inject the manager:

```
use Vinkla\Hashids\HashidsManager;

class Foo
{
    protected $hashids;

    public function __construct(HashidsManager $hashids)
    {
        $this->hashids = $hashids;
    }

    public function bar($id)
    {
        $this->hashids->encode($id);
    }
}

App::make('Foo')->bar();
```

For more information on how to use the `Hashids\Hashids` class, check out the docs at [`hashids/hashids`](https://github.com/vinkla/hashids.php).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 90.6% 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 ~104 days

Recently: every ~190 days

Total

26

Last Release

1546d ago

Major Versions

5.2.0 → 6.0.02019-04-03

6.0.0 → 7.0.02019-08-28

7.0.0 → 8.0.02020-01-31

8.1.0 → 9.0.02020-09-07

9.1.0 → 10.0.02022-01-24

PHP version history (12 changes)1.0.0PHP &gt;=5.4.7

1.1.0PHP &gt;=5.5.9

2.2.1PHP ^5.5.9 || ^7.0

2.4.0PHP ^5.6.4 || ^7.0

3.1.0PHP ^7.0

4.0.0PHP ^7.1.3

6.0.0PHP ^7.2

8.0.0PHP ^7.4

8.1.0PHP ^7.2.5

9.0.0PHP ^7.3

9.1.0PHP ^7.3 || ^8.0

10.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/63515814?v=4)[SuperDev](/maintainers/Supernova3339)[@Supernova3339](https://github.com/Supernova3339)

---

Top Contributors

[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (240 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (4 commits)")[![Supernova3339](https://avatars.githubusercontent.com/u/63515814?v=4)](https://github.com/Supernova3339 "Supernova3339 (4 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (3 commits)")[![Indemnity83](https://avatars.githubusercontent.com/u/35218?v=4)](https://github.com/Indemnity83 "Indemnity83 (2 commits)")[![lucasmichot](https://avatars.githubusercontent.com/u/513603?v=4)](https://github.com/lucasmichot "lucasmichot (2 commits)")[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (1 commits)")[![palvaneh](https://avatars.githubusercontent.com/u/12458954?v=4)](https://github.com/palvaneh "palvaneh (1 commits)")[![ptondereau](https://avatars.githubusercontent.com/u/4287777?v=4)](https://github.com/ptondereau "ptondereau (1 commits)")[![unicodeveloper](https://avatars.githubusercontent.com/u/2946769?v=4)](https://github.com/unicodeveloper "unicodeveloper (1 commits)")[![kainxspirits](https://avatars.githubusercontent.com/u/5594710?v=4)](https://github.com/kainxspirits "kainxspirits (1 commits)")[![chivincent](https://avatars.githubusercontent.com/u/7449005?v=4)](https://github.com/chivincent "chivincent (1 commits)")[![davidnknight](https://avatars.githubusercontent.com/u/1526840?v=4)](https://github.com/davidnknight "davidnknight (1 commits)")[![foremtehan](https://avatars.githubusercontent.com/u/53290883?v=4)](https://github.com/foremtehan "foremtehan (1 commits)")[![Gummibeer](https://avatars.githubusercontent.com/u/6187884?v=4)](https://github.com/Gummibeer "Gummibeer (1 commits)")[![asbiin](https://avatars.githubusercontent.com/u/25419741?v=4)](https://github.com/asbiin "asbiin (1 commits)")

---

Tags

laravelhashids

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[vinkla/hashids

A Hashids bridge for Laravel

2.1k14.2M78](/packages/vinkla-hashids)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)

PHPackages © 2026

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