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

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

zeroo0ooweb/hashids
===================

A Hashids bridge for Laravel

00[4 PRs](https://github.com/zeroo0ooweb/zero-laravel-hashids/pulls)PHP

Since Sep 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/zeroo0ooweb/zero-laravel-hashids)[ Packagist](https://packagist.org/packages/zeroo0ooweb/hashids)[ RSS](/packages/zeroo0ooweb-hashids/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (5)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, 'your-salt-string');

// Decode strings.
Hashids::decode('1LLb3b4ck', 'your-salt-string');

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

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

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

[](#installation)

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

```
composer require zeroo0ooweb/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 zeroo0ooweb\Hashids\Facades\Hashids;

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

// 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 zeroo0ooweb\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 zeroo0ooweb\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/zeroo0ooweb/hashids.php).

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e61bd264dcbe67ba72c8216205340808fc7d410294d80f9fd2023f94d19fec34?d=identicon)[zeroo0oo-web](/maintainers/zeroo0oo-web)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[stechstudio/laravel-php-cs-fixer

Easily format your Laravel Code with this Configuration file and accompanying artisan command.

146724.4k2](/packages/stechstudio-laravel-php-cs-fixer)[altcha-org/altcha

A lightweight PHP library for creating and verifying ALTCHA challenges.

92831.1k43](/packages/altcha-org-altcha)[culturegr/presenter

Eloquent Model Presenter for Laravel applications

141.4k](/packages/culturegr-presenter)

PHPackages © 2026

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