PHPackages                             markwalet/laravel-hashed-route - 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. [Security](/categories/security)
4. /
5. markwalet/laravel-hashed-route

AbandonedArchivedLibrary[Security](/categories/security)

markwalet/laravel-hashed-route
==============================

A Laravel package that replaces the default route model binding for a safer version.

v2.8.0(2y ago)93.9k[1 issues](https://github.com/markwalet/laravel-hashed-route/issues)MITPHPPHP 8.\*CI failing

Since Nov 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/markwalet/laravel-hashed-route)[ Packagist](https://packagist.org/packages/markwalet/laravel-hashed-route)[ Fund](https://www.paypal.me/markwalet)[ GitHub Sponsors](https://github.com/markwalet)[ RSS](/packages/markwalet-laravel-hashed-route/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (5)Versions (28)Used By (0)

[![Laravel hashed route](https://camo.githubusercontent.com/f2223023f2100f59b41ea0d46a2e46a36ea517789197bd25060a801276914721/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230686173686564253230726f7574652e706e673f7468656d653d6c69676874267061636b6167654e616d653d6d61726b77616c65742532466c61726176656c2d6861736865642d726f757465267061747465726e3d63697263756974426f617264267374796c653d7374796c655f31266465736372697074696f6e3d412b4c61726176656c2b7061636b6167652b746861742b7265706c616365732b7468652b64656661756c742b726f7574652b6d6f64656c2b62696e64696e672b666f722b612b73616665722b76657273696f6e2e266d643d302673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667267769647468733d32303026686569676874733d6175746f)](http://github.com/markwalet/laravel-hashed-route)

[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Latest Stable Version](https://camo.githubusercontent.com/0e1e5be5d56be377f258dc8cd36d4af36ad8d360e70f7bcf3e4fdcd4c59ba362/68747470733a2f2f706f7365722e707567782e6f72672f6d61726b77616c65742f6c61726176656c2d6861736865642d726f7574652f762f737461626c65)](https://packagist.org/packages/markwalet/laravel-hashed-route)[![Build status](https://camo.githubusercontent.com/8387fd05108c117808cd8e10a22af94ea668565aefd31f58dd3621aa5db024ef/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d61726b77616c65742f6c61726176656c2d6861736865642d726f7574652f74657374732e796d6c3f6272616e63683d6d6173746572)](https://github.com/markwalet/laravel-hashed-route/actions)[![Coverage](https://camo.githubusercontent.com/20ef2dc33b4f198770483b73ee5e274445d71fd1685f861145152f3a2966e0f5/68747470733a2f2f636f6465636f762e696f2f67682f6d61726b77616c65742f6c61726176656c2d6861736865642d726f7574652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/markwalet/laravel-hashed-route)[![StyleCI](https://camo.githubusercontent.com/739958a394124467f84fcc9620669f32b81c2c55ece4a379203eb651a9b00e37/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3131323438393134312f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/112489141)[![Total Downloads](https://camo.githubusercontent.com/09cb69fdd1ccbb66e4e351fd555c26ab0c3be8522d0684b53fdc27c9fcf14b61/68747470733a2f2f706f7365722e707567782e6f72672f6d61726b77616c65742f6c61726176656c2d6861736865642d726f7574652f646f776e6c6f616473)](https://packagist.org/packages/markwalet/laravel-hashed-route)

A Laravel package that replaces the default route model binding for a safer version.

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

[](#installation)

You can install this package with composer:

```
composer require markwalet/laravel-hashed-route
```

Laravel 5.5 uses Package auto-discovery, so you don't have to register the service provider. If you want to register the service provider manually, add the following line to your `config/app.php` file:

```
MarkWalet\LaravelHashedRoute\HashedRouteServiceProvider::class
```

Usage
-----

[](#usage)

When you want to hash the routes for a given model. The only thing you have to is is adding the `HasHashedRouteKey` trait:

```
use MarkWalet\LaravelHashedRoute\Concerns\HasHashedRouteKey;

class TestModel extends Model
{
    use HasHashedRouteKey;

    //...
}
```

After that you can use the model like you normally would. Because the trait overrides the `resolveRouteBinding()` and `getRouteKey()` methods, no extra changes are required to your code.

You do have to change your code when you are building your urls by manually getting the `$model->id` property from your model. Then you will have to change those calls to `$model->getRouteKey()`.

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

[](#configuration)

The default configuration is defined in `hashed-route.php`. If you want to edit this file you can copy it to your config folder by using the following command:

```
php artisan vendor:publish --provider="MarkWalet\LaravelHashedRoute\HashedRouteServiceProvider"
```

In this file you can configure different codecs for the encoding and decoding of keys, as well as setting a default configuration.

You can override this configuration by setting the `codec` property on your model.

The supported codec drivers are: `null`, `hashids`, `optimus` &amp; `base64`. Use the `null` driver if you want to disable route key hashing.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 85.8% 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 ~107 days

Recently: every ~247 days

Total

20

Last Release

1089d ago

Major Versions

v1.1.8 → v2.0.02019-08-02

PHP version history (6 changes)v1.0.0PHP &gt;=5.5.9

v2.0.0PHP &gt;=7.0.12

v2.3.0PHP &gt;=7.2

v2.5.0PHP ~7.3|8.\*

v2.6.0PHP ~7.4|8.\*

v2.8.0PHP 8.\*

### Community

Maintainers

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

---

Top Contributors

[![markwalet](https://avatars.githubusercontent.com/u/11446771?v=4)](https://github.com/markwalet "markwalet (121 commits)")[![mark-walet](https://avatars.githubusercontent.com/u/75607670?v=4)](https://github.com/mark-walet "mark-walet (20 commits)")

---

Tags

laravelphpphp-librarysecurityurllaravelsecurityhashcodec

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/markwalet-laravel-hashed-route/health.svg)

```
[![Health](https://phpackages.com/badges/markwalet-laravel-hashed-route/health.svg)](https://phpackages.com/packages/markwalet-laravel-hashed-route)
```

###  Alternatives

[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

1.0k494.9k2](/packages/akaunting-laravel-firewall)[elfsundae/laravel-hashid

A simple, elegant way to obfuscate your data by generating reversible, non-sequential, URL-safe identifiers.

412255.7k2](/packages/elfsundae-laravel-hashid)[enlightn/laravel-security-checker

A Laravel package to scan your dependencies for known security vulnerabilities.

51176.3k](/packages/enlightn-laravel-security-checker)

PHPackages © 2026

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