PHPackages                             apichef/laravel-obfuscate - 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. apichef/laravel-obfuscate

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

apichef/laravel-obfuscate
=========================

Laravel package for obfuscating ids in urls.

v4.0.1(2y ago)815.3k↓50%9[1 issues](https://github.com/apichef/laravel-obfuscate/issues)1MITPHPPHP ^8.0|^8.1|^8.2

Since Feb 12Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (6)Versions (14)Used By (1)

laravel-obfuscate
=================

[](#laravel-obfuscate)

[![Latest Version on Packagist](https://camo.githubusercontent.com/775c274ab6e83c09697016cd531c987ea297016230499fe853473790dc13461c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617069636865662f6c61726176656c2d6f62667573636174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/apichef/laravel-obfuscate)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://github.com/apichef/laravel-obfuscate/workflows/CI/badge.svg)](https://github.com/apichef/laravel-obfuscate/actions)[![Quality Score](https://camo.githubusercontent.com/784f0ef3febf992f918e1beaf6f8b2e09cbf3bce368fabc880b1533005e8a2ca/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f617069636865662f6c61726176656c2d6f62667573636174652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/apichef/laravel-obfuscate)[![Total Downloads](https://camo.githubusercontent.com/e20604e1c7138abec99e2f290407a41efa86263377f835e6e1d93c2af5747396/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617069636865662f6c61726176656c2d6f62667573636174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/apichef/laravel-obfuscate)

Easy id obfuscation for Laravel
===============================

[](#easy-id-obfuscation-for-laravel)

Install
-------

[](#install)

Via Composer

```
$ composer require apichef/laravel-obfuscate
```

LaravelMinimum Versions5.x`^1.0.0`6.x`^1.0.0`7.x`^2.0.0`8.x`^2.0.0`9.x`^3.0.0`10.x`^4.0.0`11.x`^4.0.0`Usage
-----

[](#usage)

### Route Model Binding

[](#route-model-binding)

```
// Model

namespace App;

use Illuminate\Database\Eloquent\Model;
use ApiChef\Obfuscate\Obfuscatable;

class Post extends Model
{
    use Obfuscatable;

    // ...
}

// Route

Route::get('/posts/{post}', function (Post $post) {
    return [
        'id' => $post->getRouteKey(),
        'title' => $post->title,
    ];
})->name('post.show');

// Generate the URL to a named route.

$post = Post::find(1);

echo(route('post.show', $post));

// https://my-app.test/api/posts/458047115
```

### Validation

[](#validation)

```
namespace App\Http\Requests;

use ApiChef\Obfuscate\Rules\HashExists;
use Illuminate\Foundation\Http\FormRequest;

class PostStoreRequest extends FormRequest
{
    // ...
    public function rules()
    {
        return [
            'post_id' => [
                'required',
                new HashExists('posts', 'id')
            ],
        ];
    }
}
```

### Facade

[](#facade)

```
use ApiChef\Obfuscate\Support\Facades\Obfuscate;

$result = Obfuscate::encode(1);
// 458047115

$result = Obfuscate::encode([1, 2]);
// [458047115, 2033899500]

$result = Obfuscate::decode('458047115');
// 1

$result = Obfuscate::decode([458047115, 2033899500]);
// [1, 2]
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Nimna Awantha](https://github.com/nimnaherath)
- [Milroy E. Fraser](https://github.com/milroyfraser)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 78.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 ~167 days

Recently: every ~321 days

Total

10

Last Release

782d ago

Major Versions

v0.0.5 → 1.0.02020-08-02

1.0.0 → 2.0.02020-09-20

2.0.1 → 3.0.12022-02-12

3.0.1 → v4.x-dev2024-03-26

PHP version history (5 changes)v0.0.1PHP ~7.2

2.0.0PHP ^7.3

2.0.1PHP ^7.3 || ^8.0

3.0.1PHP ^7.3|^8.0|^8.1

v4.x-devPHP ^8.0|^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f3ba1935044647e51c405868792beea05a76250a8f7ef408c9b706edf51fcb6?d=identicon)[milroy.me](/maintainers/milroy.me)

---

Top Contributors

[![milroyfraser](https://avatars.githubusercontent.com/u/3282475?v=4)](https://github.com/milroyfraser "milroyfraser (22 commits)")[![nimnaherath](https://avatars.githubusercontent.com/u/73551247?v=4)](https://github.com/nimnaherath "nimnaherath (5 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

laravelobfuscation

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/apichef-laravel-obfuscate/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[glhd/special

1929.4k](/packages/glhd-special)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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